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.
This commit is contained in:
Vincent Povirk 2009-05-01 15:37:35 -05:00 committed by Alexandre Julliard
parent 966fd5ec09
commit cb478a3258
1 changed files with 4 additions and 4 deletions

View File

@ -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);