Alexandre Julliard : gdi32: Move the pen/brush_region helpers to graphics. c and avoid redundant clipping.

Alexandre Julliard julliard at winehq.org
Fri Apr 13 11:03:21 CDT 2012


Module: wine
Branch: master
Commit: 568afc210ef3639e4170dc65497e2f4eee85413f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=568afc210ef3639e4170dc65497e2f4eee85413f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Apr 13 13:36:23 2012 +0200

gdi32: Move the pen/brush_region helpers to graphics.c and avoid redundant clipping.

---

 dlls/gdi32/dibdrv/dibdrv.h   |    2 --
 dlls/gdi32/dibdrv/graphics.c |   16 ++++++++++++++--
 dlls/gdi32/dibdrv/objects.c  |   14 --------------
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/dlls/gdi32/dibdrv/dibdrv.h b/dlls/gdi32/dibdrv/dibdrv.h
index fb7eb21..b374840 100644
--- a/dlls/gdi32/dibdrv/dibdrv.h
+++ b/dlls/gdi32/dibdrv/dibdrv.h
@@ -245,8 +245,6 @@ extern BOOL convert_dib(dib_info *dst, const dib_info *src) DECLSPEC_HIDDEN;
 extern COLORREF make_rgb_colorref( HDC hdc, dib_info *dib, COLORREF color, BOOL *got_pixel, DWORD *pixel ) DECLSPEC_HIDDEN;
 extern DWORD get_pixel_color(dibdrv_physdev *pdev, COLORREF color, BOOL mono_fixup) DECLSPEC_HIDDEN;
 extern BOOL brush_rect( dibdrv_physdev *pdev, dib_brush *brush, const RECT *rect, HRGN clip, INT rop ) DECLSPEC_HIDDEN;
-extern BOOL brush_region( dibdrv_physdev *pdev, HRGN region ) DECLSPEC_HIDDEN;
-extern BOOL pen_region( dibdrv_physdev *pdev, HRGN region ) DECLSPEC_HIDDEN;
 extern int get_clipped_rects( const dib_info *dib, const RECT *rc, HRGN clip, struct clipped_rects *clip_rects ) DECLSPEC_HIDDEN;
 extern int clip_line(const POINT *start, const POINT *end, const RECT *clip,
                      const bres_params *params, POINT *pt1, POINT *pt2) DECLSPEC_HIDDEN;
diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index 2f67efe..5cffeac 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -26,6 +26,20 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dib);
 
+/* paint a region with the brush (note: the region can be modified) */
+static BOOL brush_region( dibdrv_physdev *pdev, HRGN region )
+{
+    if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
+    return brush_rect( pdev, &pdev->brush, NULL, region, GetROP2( pdev->dev.hdc ));
+}
+
+/* paint a region with the pen (note: the region can be modified) */
+static BOOL pen_region( dibdrv_physdev *pdev, HRGN region )
+{
+    if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
+    return brush_rect( pdev, &pdev->pen_brush, NULL, region, GetROP2( pdev->dev.hdc ));
+}
+
 static RECT get_device_rect( HDC hdc, int left, int top, int right, int bottom, BOOL rtl_correction )
 {
     RECT rect;
@@ -813,7 +827,6 @@ BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y )
 
     if (region)
     {
-        if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
         ret = pen_region( pdev, region );
         DeleteObject( region );
     }
@@ -968,7 +981,6 @@ BOOL dibdrv_PolyPolyline( PHYSDEV dev, const POINT* pt, const DWORD* counts, DWO
 
     if (outline)
     {
-        if (pdev->clip) CombineRgn( outline, outline, pdev->clip, RGN_AND );
         ret = pen_region( pdev, outline );
         DeleteObject( outline );
     }
diff --git a/dlls/gdi32/dibdrv/objects.c b/dlls/gdi32/dibdrv/objects.c
index a9d6ca5..acb7091 100644
--- a/dlls/gdi32/dibdrv/objects.c
+++ b/dlls/gdi32/dibdrv/objects.c
@@ -2162,17 +2162,3 @@ BOOL brush_rect(dibdrv_physdev *pdev, dib_brush *brush, const RECT *rect, HRGN c
     free_clipped_rects( &clipped_rects );
     return ret;
 }
-
-/* paint a region with the brush (note: the region can be modified) */
-BOOL brush_region( dibdrv_physdev *pdev, HRGN region )
-{
-    if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
-    return brush_rect( pdev, &pdev->brush, NULL, region, GetROP2( pdev->dev.hdc ));
-}
-
-/* paint a region with the pen (note: the region can be modified) */
-BOOL pen_region( dibdrv_physdev *pdev, HRGN region )
-{
-    if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
-    return brush_rect( pdev, &pdev->pen_brush, NULL, region, GetROP2( pdev->dev.hdc ));
-}




More information about the wine-cvs mailing list