Huw Davies : gdi32: Add a helper to fill rectangles with a given pixel.
Alexandre Julliard
julliard at winehq.org
Tue Jan 2 15:01:23 CST 2018
Module: wine
Branch: stable
Commit: b5565f2a523f3323924d36b91e4d491121cc9515
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b5565f2a523f3323924d36b91e4d491121cc9515
Author: Huw Davies <huw at codeweavers.com>
Date: Mon Jul 24 10:47:03 2017 +0100
gdi32: Add a helper to fill rectangles with a given pixel.
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 46e6ee48f3cd5a6eeec50db2a8c7db17025c606f)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/gdi32/dibdrv/dibdrv.h | 1 +
dlls/gdi32/dibdrv/objects.c | 19 +++++++++++++++----
2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h
index 770e89e..adf16c4 100644
--- a/dlls/gdi32/dibdrv/dibdrv.h
+++ b/dlls/gdi32/dibdrv/dibdrv.h
@@ -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 )
{
diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index cde20e3..8e55d1a 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -1754,6 +1754,20 @@ COLORREF dibdrv_SetDCPenColor( PHYSDEV dev, COLORREF 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
*
* Fill a number of rectangles with the 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 )
More information about the wine-cvs
mailing list