ReactOS  0.4.14-dev-368-gfa26425
paint.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS kernel
4  * PURPOSE: GDI Driver Paint Functions
5  * FILE: win32ss/gdi/eng/paint.c
6  * PROGRAMERS: Timo Kreuzer (timo.kreuzer@reactos.org)
7  * Jason Filby
8  */
9 
10 #include <win32k.h>
11 
12 #define NDEBUG
13 #include <debug.h>
14 
15 const BYTE gajRop2ToRop3[16] =
16 {
17  0x00, // 1: R2_BLACK 0
18  0x05, // 2: R2_NOTMERGEPEN DPon
19  0x0A, // 3: R2_MASKNOTPEN DPna
20  0x0F, // 4: R2_NOTCOPYPEN Pn
21  0x50, // 5: R2_MASKPENNOT PDna
22  0x55, // 6: R2_NOT Dn
23  0x5A, // 7: R2_XORPEN DPx
24  0x5F, // 8: R2_NOTMASKPEN DPan
25  0xA0, // 9: R2_MASKPEN DPa
26  0xA5, // 10: R2_NOTXORPEN PDxn
27  0xAA, // 11: R2_NOP D
28  0xAF, // 12: R2_MERGENOTPEN DPno
29  0xF0, // 13: R2_COPYPEN P
30  0xF5, // 14: R2_MERGEPENNOT PDno
31  0xFA, // 15: R2_MERGEPEN DPo
32  0xFF, // 16: R2_WHITE 1
33 };
34 
36 {
37  LONG y;
38  ULONG LineWidth;
39 
40  ASSERT(pso);
41  ASSERT(pRect);
42  LineWidth = pRect->right - pRect->left;
43  DPRINT(" LineWidth: %lu, top: %ld, bottom: %ld\n", LineWidth, pRect->top, pRect->bottom);
44  for (y = pRect->top; y < pRect->bottom; y++)
45  {
47  pso, pRect->left, pRect->right, y, iColor);
48  }
49  return TRUE;
50 }
51 
52 BOOL
55  _In_ SURFOBJ *pso,
56  _In_ CLIPOBJ *pco,
57  _In_ BRUSHOBJ *pbo,
59  _In_ __in_data_source(USER_MODE) MIX mix)
60 {
61  ROP4 rop4;
62 
63  /* Convert the MIX, consisting of 2 ROP2 codes into a ROP4 */
64  rop4 = MIX_TO_ROP4(mix);
65 
66  /* Sanity check */
68 
69  /* Forward the call to Eng/DrvBitBlt */
70  return IntEngBitBlt(pso,
71  NULL,
72  NULL,
73  pco,
74  NULL,
75  &pco->rclBounds,
76  NULL,
77  NULL,
78  pbo,
80  rop4);
81 }
82 
83 BOOL
86  _In_ SURFOBJ *pso,
87  _In_ CLIPOBJ *pco,
88  _In_ BRUSHOBJ *pbo,
90  _In_ __in_data_source(USER_MODE) MIX mix)
91 {
92  SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
93 
94  /* Is the surface's Paint function hooked? */
95  if ((pso->iType != STYPE_BITMAP) && (psurf->flags & HOOK_PAINT))
96  {
97  /* Call the driver's DrvPaint */
98  return GDIDEVFUNCS(pso).Paint(pso, pco, pbo, pptlBrushOrg, mix);
99  }
100 
101  return EngPaint(pso, pco, pbo, pptlBrushOrg, mix);
102 }
103 
104 /* EOF */
const BYTE gajRop2ToRop3[16]
Definition: paint.c:15
#define TRUE
Definition: types.h:120
ULONG MIX
Definition: winddi.h:129
#define STYPE_BITMAP
Definition: winddi.h:1175
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3433
long bottom
Definition: polytest.cpp:53
BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
Definition: paint.c:35
ULONG ROP4
Definition: winddi.h:128
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL * pptlBrushOrg
Definition: winddi.h:3591
BOOL APIENTRY IntEngPaint(_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
Definition: paint.c:85
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
GLint GLint bottom
Definition: glext.h:7726
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
long left
Definition: polytest.cpp:53
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
_Must_inspect_result_ _In_ __in_data_source(USER_MODE) SIZE_T Size
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3664
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
unsigned char BYTE
Definition: mem.h:68
BOOL APIENTRY EngPaint(_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
Definition: paint.c:54
PFN_DIB_HLine DIB_HLine
Definition: dib.h:47
#define _In_
Definition: no_sal2.h:204
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
FLONG flags
Definition: surface.h:10
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
unsigned int ULONG
Definition: retypes.h:1
#define HOOK_PAINT
Definition: winddi.h:1424
#define MIX_TO_ROP4(mix)
Definition: eng.h:5
#define APIENTRY
Definition: api.h:79
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
Definition: bitblt.c:604
_In_ ULONG iColor
Definition: xlateobj.h:17
#define NT_ASSERT
Definition: rtlfuncs.h:3312