Vincent Povirk : gdiplus: Don't draw outside of gradient lines.

Alexandre Julliard julliard at winehq.org
Mon May 4 09:06:37 CDT 2009


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

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Fri May  1 15:37:35 2009 -0500

gdiplus: Don't draw outside of gradient lines.

Currently, gradients are drawn by filling a series of quadrilaterals,
with one side equal to a gradient line and the other side equal to the
edge of the bounding rectangle of the area being filled. A single
pixel can be filled many times, and that causes flicker.

---

 dlls/gdiplus/graphics.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 219ed75..9ba7d47 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -273,9 +273,7 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
                     rightx = rc.right;
                 }
 
-                poly[0].x = rc.right;
                 poly[0].y = rc.bottom;
-                poly[1].x = rc.right;
                 poly[1].y = rc.top;
                 poly[2].y = rc.top;
                 poly[3].y = rc.bottom;
@@ -286,6 +284,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
                     col = ARGB2COLORREF(argb);
                     hbrush = CreateSolidBrush(col);
                     hprevbrush = SelectObject(graphics->hdc, hbrush);
+                    poly[0].x = x - tilt - 1;
+                    poly[1].x = x - 1;
                     poly[2].x = x;
                     poly[3].x = x - tilt;
                     Polygon(graphics->hdc, poly, 4);
@@ -323,9 +323,7 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
                 }
 
                 poly[0].x = rc.right;
-                poly[0].y = rc.bottom;
                 poly[1].x = rc.left;
-                poly[1].y = rc.bottom;
                 poly[2].x = rc.left;
                 poly[3].x = rc.right;
 
@@ -335,6 +333,8 @@ static void brush_fill_path(GpGraphics *graphics, GpBrush* brush)
                     col = ARGB2COLORREF(argb);
                     hbrush = CreateSolidBrush(col);
                     hprevbrush = SelectObject(graphics->hdc, hbrush);
+                    poly[0].y = y - tilt - 1;
+                    poly[1].y = y - 1;
                     poly[2].y = y;
                     poly[3].y = y - tilt;
                     Polygon(graphics->hdc, poly, 4);




More information about the wine-cvs mailing list