Vincent Povirk : gdiplus: Add software implementation of GdipFillPath.

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


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

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

gdiplus: Add software implementation of GdipFillPath.

---

 dlls/gdiplus/graphics.c |   66 +++++++++++++++++++++++++++++++++++++----------
 1 files changed, 52 insertions(+), 14 deletions(-)

diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 83e0f24..978e12b 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -3402,24 +3402,13 @@ GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics *graphics, GpBrush *brush, INT x
     return GdipFillEllipse(graphics,brush,(REAL)x,(REAL)y,(REAL)width,(REAL)height);
 }
 
-GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
+static GpStatus GDI32_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
 {
     INT save_state;
     GpStatus retval;
 
-    TRACE("(%p, %p, %p)\n", graphics, brush, path);
-
-    if(!brush || !graphics || !path)
-        return InvalidParameter;
-
-    if(graphics->busy)
-        return ObjectBusy;
-
-    if(!graphics->hdc)
-    {
-        FIXME("graphics object has no HDC\n");
-        return Ok;
-    }
+    if(!graphics->hdc || !brush_can_fill_path(brush))
+        return NotImplemented;
 
     save_state = SaveDC(graphics->hdc);
     EndPath(graphics->hdc);
@@ -3444,6 +3433,55 @@ end:
     return retval;
 }
 
+static GpStatus SOFTWARE_GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
+{
+    GpStatus stat;
+    GpRegion *rgn;
+
+    if (!brush_can_fill_pixels(brush))
+        return NotImplemented;
+
+    /* FIXME: This could probably be done more efficiently without regions. */
+
+    stat = GdipCreateRegionPath(path, &rgn);
+
+    if (stat == Ok)
+    {
+        stat = GdipFillRegion(graphics, brush, rgn);
+
+        GdipDeleteRegion(rgn);
+    }
+
+    return stat;
+}
+
+GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
+{
+    GpStatus stat = NotImplemented;
+
+    TRACE("(%p, %p, %p)\n", graphics, brush, path);
+
+    if(!brush || !graphics || !path)
+        return InvalidParameter;
+
+    if(graphics->busy)
+        return ObjectBusy;
+
+    if (!graphics->image)
+        stat = GDI32_GdipFillPath(graphics, brush, path);
+
+    if (stat == NotImplemented)
+        stat = SOFTWARE_GdipFillPath(graphics, brush, path);
+
+    if (stat == NotImplemented)
+    {
+        FIXME("Not implemented for brushtype %i\n", brush->bt);
+        stat = Ok;
+    }
+
+    return stat;
+}
+
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
     REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
 {




More information about the wine-cvs mailing list