Vincent Povirk : gdiplus: Use GdipFillPath to implement GdipFillPie.

Alexandre Julliard julliard at winehq.org
Tue Mar 15 11:33:55 CDT 2011


Module: wine
Branch: master
Commit: 2ce5be2ce3e36250c588523dfc27261283fcab41
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2ce5be2ce3e36250c588523dfc27261283fcab41

Author: Vincent Povirk <vincent at codeweavers.com>
Date:   Thu Mar 10 16:36:08 2011 -0600

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 6682f74..262828b 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,




More information about the wine-cvs mailing list