From 2ce5be2ce3e36250c588523dfc27261283fcab41 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 10 Mar 2011 16:36:08 -0600 Subject: [PATCH] gdiplus: Use GdipFillPath to implement GdipFillPie. --- dlls/gdiplus/graphics.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 6682f74ad96..262828bd426 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) + stat = GdipCreatePath(FillModeAlternate, &path); + + if (stat == Ok) { - FIXME("graphics object has no HDC\n"); - return Ok; + stat = GdipAddPathPie(path, x, y, width, height, startAngle, sweepAngle); + + if (stat == Ok) + stat = GdipFillPath(graphics, brush, path); + + GdipDeletePath(path); } - save_state = SaveDC(graphics->hdc); - EndPath(graphics->hdc); - - BeginPath(graphics->hdc); - draw_pie(graphics, x, y, width, height, startAngle, sweepAngle); - EndPath(graphics->hdc); - - brush_fill_path(graphics, brush); - - RestoreDC(graphics->hdc, save_state); - - return Ok; + return stat; } GpStatus WINGDIPAPI GdipFillPieI(GpGraphics *graphics, GpBrush *brush, INT x,