Vincent Povirk : gdiplus: Store the rectangle in line gradient brushes.
Alexandre Julliard
julliard at winehq.org
Fri May 8 08:06:27 CDT 2009
Module: wine
Branch: master
Commit: 173a1f6f7981d395abfb46c5068f53b7ecc85fc4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=173a1f6f7981d395abfb46c5068f53b7ecc85fc4
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu May 7 11:33:28 2009 -0500
gdiplus: Store the rectangle in line gradient brushes.
---
dlls/gdiplus/brush.c | 11 ++++++-----
dlls/gdiplus/gdiplus_private.h | 1 +
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index 60d5970..7372ec0 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -250,6 +250,11 @@ GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
(*line)->wrap = wrap;
(*line)->gamma = FALSE;
+ (*line)->rect.X = (startpoint->X < endpoint->X ? startpoint->X: endpoint->X);
+ (*line)->rect.Y = (startpoint->Y < endpoint->Y ? startpoint->Y: endpoint->Y);
+ (*line)->rect.Width = fabs(startpoint->X - endpoint->X);
+ (*line)->rect.Height = fabs(startpoint->Y - endpoint->Y);
+
(*line)->blendcount = 1;
(*line)->blendfac = GdipAlloc(sizeof(REAL));
(*line)->blendpos = GdipAlloc(sizeof(REAL));
@@ -1538,11 +1543,7 @@ GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
if(!brush || !rect)
return InvalidParameter;
- rect->X = (brush->startpoint.X < brush->endpoint.X ? brush->startpoint.X: brush->endpoint.X);
- rect->Y = (brush->startpoint.Y < brush->endpoint.Y ? brush->startpoint.Y: brush->endpoint.Y);
-
- rect->Width = fabs(brush->startpoint.X - brush->endpoint.X);
- rect->Height = fabs(brush->startpoint.Y - brush->endpoint.Y);
+ *rect = brush->rect;
return Ok;
}
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index e038baf..f3bf797 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -143,6 +143,7 @@ struct GpLineGradient{
GpPointF endpoint;
ARGB startcolor;
ARGB endcolor;
+ RectF rect;
GpWrapMode wrap;
BOOL gamma;
REAL* blendfac; /* blend factors */
More information about the wine-cvs
mailing list