From 4d72d73462a88e830f7cd9e34c3178a33ed1c246 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Mar 2011 16:36:08 -0600 Subject: [PATCH 5/9] gdiplus: Use GdipFillPath to implement GdipFillPie. --- dlls/gdiplus/graphics.c | 26 +++++++++++--------------- 1 files changed, 11 insertions(+), 15 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c17118c..52034e8 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -3472,7 +3472,8 @@ GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *p GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle) { - INT save_state; + GpStatus stat; + GpPath *path; TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %.2f, %.2f)\n", graphics, brush, x, y, width, height, startAngle, sweepAngle); @@ -3483,24 +3484,19 @@ GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x, if(graphics->busy) return ObjectBusy; - if(!graphics->hdc) - { - FIXME("graphics object has no HDC\n"); - return Ok; - } - - save_state = SaveDC(graphics->hdc); - EndPath(graphics->hdc); + stat = GdipCreatePath(FillModeAlternate, &path); - BeginPath(graphics->hdc); - draw_pie(graphics, x, y, width, height, startAngle, sweepAngle); - EndPath(graphics->hdc); + if (stat == Ok) + { + stat = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle); - 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 GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x, -- 1.7.2.3