2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: GDI Driver Paint Functions
5 * FILE: subsys/win32k/eng/paint.c
6 * PROGRAMER: Jason Filby
14 BOOL APIENTRY
FillSolid(SURFOBJ
*pso
, PRECTL pRect
, ULONG iColor
)
21 LineWidth
= pRect
->right
- pRect
->left
;
22 DPRINT(" LineWidth: %d, top: %d, bottom: %d\n", LineWidth
, pRect
->top
, pRect
->bottom
);
23 for (y
= pRect
->top
; y
< pRect
->bottom
; y
++)
25 DibFunctionsForBitmapFormat
[pso
->iBitmapFormat
].DIB_HLine(
26 pso
, pRect
->left
, pRect
->right
, y
, iColor
);
32 EngPaintRgn(SURFOBJ
*pso
, CLIPOBJ
*ClipRegion
, ULONG iColor
, MIX Mix
,
33 BRUSHOBJ
*BrushObj
, POINTL
*BrushPoint
)
42 DPRINT("ClipRegion->iMode:%d, ClipRegion->iDComplexity: %d\n Color: %d", ClipRegion
->iMode
, ClipRegion
->iDComplexity
, iColor
);
43 switch(ClipRegion
->iMode
) {
47 /* Rectangular clipping can be handled without enumeration.
48 Note that trivial clipping is not possible, since the clipping
49 region defines the area to fill */
51 if (ClipRegion
->iDComplexity
== DC_RECT
)
53 FillSolid(pso
, &(ClipRegion
->rclBounds
), iColor
);
56 /* Enumerate all the rectangles and draw them */
57 CLIPOBJ_cEnumStart(ClipRegion
, FALSE
, CT_RECTANGLES
, CD_ANY
, 0);
60 EnumMore
= CLIPOBJ_bEnum(ClipRegion
, sizeof(RectEnum
), (PVOID
) &RectEnum
);
61 for (i
= 0; i
< RectEnum
.c
; i
++) {
62 FillSolid(pso
, RectEnum
.arcl
+ i
, iColor
);
78 EngPaint(IN SURFOBJ
*pso
,
79 IN CLIPOBJ
*ClipRegion
,
81 IN POINTL
*BrushOrigin
,
86 // FIXME: We only support a brush's solid color attribute
87 ret
= EngPaintRgn(pso
, ClipRegion
, Brush
->iSolidColor
, Mix
, Brush
, BrushOrigin
);
93 IntEngPaint(IN SURFOBJ
*pso
,
94 IN CLIPOBJ
*ClipRegion
,
96 IN POINTL
*BrushOrigin
,
99 SURFACE
*psurf
= CONTAINING_RECORD(pso
, SURFACE
, SurfObj
);
102 DPRINT("pso->iType == %d\n", pso
->iType
);
103 /* Is the surface's Paint function hooked? */
104 if((pso
->iType
!=STYPE_BITMAP
) && (psurf
->flags
& HOOK_PAINT
))
106 // Call the driver's DrvPaint
107 ret
= GDIDEVFUNCS(pso
).Paint(
108 pso
, ClipRegion
, Brush
, BrushOrigin
, Mix
);
111 return EngPaint(pso
, ClipRegion
, Brush
, BrushOrigin
, Mix
);