From f5549ae1d00d8bc0e02d14ec66aacbf9d14ce695 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 29 Dec 2011 09:57:41 +0100 Subject: [PATCH] gdi32: Use a region to render geometric and wide pens in LineTo. --- dlls/gdi32/dibdrv/graphics.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/dlls/gdi32/dibdrv/graphics.c b/dlls/gdi32/dibdrv/graphics.c index 00d0e2abd1b..4fb112620c1 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; } /*********************************************************************** -- 2.11.4.GIT