From eb2f75da339731ed082d3fa4aea2adaf63a7414f Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Mar 2011 16:29:08 -0600 Subject: [PATCH 4/9] 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 2e5e101..c17118c 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, -- 1.7.2.3