Vincent Povirk : gdiplus: Use GdipFillPath to implement GdipFillEllipse.
Alexandre Julliard
julliard at winehq.org
Tue Mar 15 11:33:55 CDT 2011
Module: wine
Branch: master
Commit: 4aa99eaf3b1981f89632674dbb7b2adbce163aed
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4aa99eaf3b1981f89632674dbb7b2adbce163aed
Author: Vincent Povirk <vincent at codeweavers.com>
Date: Thu Mar 10 16:29:08 2011 -0600
gdiplus: Use GdipFillPath to implement GdipFillEllipse.
---
dlls/gdiplus/graphics.c | 35 +++++++++++------------------------
1 files changed, 11 insertions(+), 24 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 978e12b..6682f74 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3355,9 +3355,8 @@ GpStatus WINGDIPAPI GdipFillClosedCurveI(GpGraphics *graphics, GpBrush *brush,
GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x,
REAL y, REAL width, REAL height)
{
- INT save_state;
- GpPointF ptf[2];
- POINT pti[2];
+ GpStatus stat;
+ GpPath *path;
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height);
@@ -3367,31 +3366,19 @@ GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x
if(graphics->busy)
return ObjectBusy;
- if(!graphics->hdc)
- {
- FIXME("graphics object has no HDC\n");
- return Ok;
- }
-
- ptf[0].X = x;
- ptf[0].Y = y;
- ptf[1].X = x + width;
- ptf[1].Y = y + height;
-
- save_state = SaveDC(graphics->hdc);
- EndPath(graphics->hdc);
-
- transform_and_round_points(graphics, pti, ptf, 2);
+ stat = GdipCreatePath(FillModeAlternate, &path);
- BeginPath(graphics->hdc);
- Ellipse(graphics->hdc, pti[0].x, pti[0].y, pti[1].x, pti[1].y);
- EndPath(graphics->hdc);
+ if (stat == Ok)
+ {
+ stat = GdipAddPathEllipse(path, x, y, width, height);
- brush_fill_path(graphics, brush);
+ if (stat == Ok)
+ stat = GdipFillPath(graphics, brush, path);
- RestoreDC(graphics->hdc, save_state);
+ GdipDeletePath(path);
+ }
- return Ok;
+ return stat;
}
GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x,
More information about the wine-cvs
mailing list