Alexandre Julliard : gdi32: Use a region to render geometric and wide pens in LineTo.

Alexandre Julliard julliard at winehq.org
Thu Dec 29 12:15:44 CST 2011


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Dec 29 09:57:41 2011 +0100

gdi32: Use a region to render geometric and wide pens in LineTo.

---

 dlls/gdi32/dibdrv/graphics.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c
index 00d0e2a..4fb1126 100644
--- a/dlls/gdi32/dibdrv/graphics.c
+++ b/dlls/gdi32/dibdrv/graphics.c
@@ -444,6 +444,10 @@ BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y )
     PHYSDEV next = GET_NEXT_PHYSDEV( dev, pLineTo );
     dibdrv_physdev *pdev = get_dibdrv_pdev(dev);
     POINT pts[2];
+    HRGN region = 0;
+    BOOL ret;
+
+    if(defer_pen(pdev)) return next->funcs->pLineTo( next, x, y );
 
     GetCurrentPositionEx(dev->hdc, pts);
     pts[1].x = x;
@@ -451,12 +455,19 @@ BOOL dibdrv_LineTo( PHYSDEV dev, INT x, INT y )
 
     LPtoDP(dev->hdc, pts, 2);
 
+    if (pdev->pen_uses_region && !(region = CreateRectRgn( 0, 0, 0, 0 ))) return FALSE;
+
     reset_dash_origin(pdev);
 
-    if(defer_pen(pdev) || !pdev->pen_lines(pdev, 2, pts, FALSE, 0))
-        return next->funcs->pLineTo( next, x, y );
+    ret = pdev->pen_lines(pdev, 2, pts, FALSE, region);
 
-    return TRUE;
+    if (region)
+    {
+        if (pdev->clip) CombineRgn( region, region, pdev->clip, RGN_AND );
+        ret = pen_rect( pdev, NULL, region, GetROP2(dev->hdc) );
+        DeleteObject( region );
+    }
+    return ret;
 }
 
 /***********************************************************************




More information about the wine-cvs mailing list