Dmitry Timoshkov : gdiplus: Reimplement GdipDrawArc using GdipDrawPath.
Alexandre Julliard
julliard at winehq.org
Tue Feb 19 13:33:03 CST 2013
Module: wine
Branch: master
Commit: 89f380f69b36680cba2bc16ea03ee60231a73230
URL: http://source.winehq.org/git/wine.git/?a=commit;h=89f380f69b36680cba2bc16ea03ee60231a73230
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Tue Feb 19 11:45:08 2013 +0800
gdiplus: Reimplement GdipDrawArc using GdipDrawPath.
---
dlls/gdiplus/graphics.c | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 738a54c..b408db4 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -2503,9 +2503,8 @@ GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
{
- INT save_state, num_pts;
- GpPointF points[MAX_ARC_PTS];
- GpStatus retval;
+ GpStatus status;
+ GpPath *path;
TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, pen, x, y,
width, height, startAngle, sweepAngle);
@@ -2516,21 +2515,15 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics *graphics, GpPen *pen, REAL x,
if(graphics->busy)
return ObjectBusy;
- if (!graphics->hdc)
- {
- FIXME("graphics object has no HDC\n");
- return Ok;
- }
-
- num_pts = arc2polybezier(points, x, y, width, height, startAngle, sweepAngle);
-
- save_state = prepare_dc(graphics, pen);
-
- retval = draw_polybezier(graphics, pen, points, num_pts, TRUE);
+ status = GdipCreatePath(FillModeAlternate, &path);
+ if (status != Ok) return status;
- restore_dc(graphics, save_state);
+ status = GdipAddPathArc(path, x, y, width, height, startAngle, sweepAngle);
+ if (status == Ok)
+ status = GdipDrawPath(graphics, pen, path);
- return retval;
+ GdipDeletePath(path);
+ return status;
}
GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics *graphics, GpPen *pen, INT x,
More information about the wine-cvs
mailing list