ReactOS 0.4.16-dev-125-g798ea90
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
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
52BOOL
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 */
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
83BOOL
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 */
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define APIENTRY
Definition: api.h:79
#define MIX_TO_ROP4(mix)
Definition: eng.h:5
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint bottom
Definition: glext.h:7726
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
#define ASSERT(a)
Definition: mode.c:44
#define _In_
Definition: ms_sal.h:308
long LONG
Definition: pedump.c:60
#define DPRINT
Definition: sndvol32.h:73
#define __in_data_source(src_sym)
Definition: specstrings.h:348
PFN_DIB_HLine DIB_HLine
Definition: dib.h:47
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
FLONG flags
Definition: surface.h:10
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59
DIB_FUNCTIONS DibFunctionsForBitmapFormat[]
Definition: dib.c:20
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:656
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
BOOL APIENTRY FillSolid(SURFOBJ *pso, PRECTL pRect, ULONG iColor)
Definition: paint.c:35
const BYTE gajRop2ToRop3[16]
Definition: paint.c:15
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
#define GDIDEVFUNCS(SurfObj)
Definition: surface.h:106
#define STYPE_BITMAP
Definition: winddi.h:1175
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3595
_In_ HANDLE _In_ SURFOBJ * pso
Definition: winddi.h:3665
#define HOOK_PAINT
Definition: winddi.h:1424
_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:3442
_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:3440
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL * pptlBrushOrg
Definition: winddi.h:3594
ULONG MIX
Definition: winddi.h:129
ULONG ROP4
Definition: winddi.h:128
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3415
#define NT_ASSERT
Definition: rtlfuncs.h:3324
_In_ ULONG iColor
Definition: xlateobj.h:17
unsigned char BYTE
Definition: xxhash.c:193