gdi32: Add a helper to fill rectangles with a given pixel.
Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
b42a15513e
commit
46e6ee48f3
|
@ -257,6 +257,7 @@ extern void add_clipped_bounds( dibdrv_physdev *dev, const RECT *rect, HRGN clip
|
|||
extern int clip_line(const POINT *start, const POINT *end, const RECT *clip,
|
||||
const bres_params *params, POINT *pt1, POINT *pt2) DECLSPEC_HIDDEN;
|
||||
extern void release_cached_font( struct cached_font *font ) DECLSPEC_HIDDEN;
|
||||
extern BOOL fill_with_pixel( DC *dc, dib_info *dib, DWORD pixel, int num, const RECT *rects, INT rop ) DECLSPEC_HIDDEN;
|
||||
|
||||
static inline void init_clipped_rects( struct clipped_rects *clip_rects )
|
||||
{
|
||||
|
|
|
@ -1753,6 +1753,20 @@ COLORREF dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
|
|||
return color;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* fill_with_pixel
|
||||
*
|
||||
* Fill a number of rectangles with a given pixel color and rop mode
|
||||
*/
|
||||
BOOL fill_with_pixel( DC *dc, dib_info *dib, DWORD pixel, int num, const RECT *rects, INT rop )
|
||||
{
|
||||
rop_mask mask;
|
||||
|
||||
calc_rop_masks( rop, pixel, &mask );
|
||||
dib->funcs->solid_rects( dib, num, rects, mask.and, mask.xor );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* solid_brush
|
||||
*
|
||||
|
@ -1762,12 +1776,9 @@ static BOOL solid_brush(dibdrv_physdev *pdev, dib_brush *brush, dib_info *dib,
|
|||
int num, const RECT *rects, INT rop)
|
||||
{
|
||||
DC *dc = get_physdev_dc( &pdev->dev );
|
||||
rop_mask brush_color;
|
||||
DWORD color = get_pixel_color( dc, &pdev->dib, brush->colorref, TRUE );
|
||||
|
||||
calc_rop_masks( rop, color, &brush_color );
|
||||
dib->funcs->solid_rects( dib, num, rects, brush_color.and, brush_color.xor );
|
||||
return TRUE;
|
||||
return fill_with_pixel( dc, dib, color, num, rects, rop );
|
||||
}
|
||||
|
||||
static BOOL alloc_brush_mask_bits( dib_brush *brush )
|
||||
|
|
Loading…
Reference in New Issue