Evan Stade : gdiplus: Added GdipFillPath.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jul 16 08:23:44 CDT 2007


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

Author: Evan Stade <estade at gmail.com>
Date:   Fri Jul 13 20:19:46 2007 -0700

gdiplus: Added GdipFillPath.

---

 dlls/gdiplus/gdiplus.spec |    2 +-
 dlls/gdiplus/graphics.c   |   32 ++++++++++++++++++++++++++++++++
 include/gdiplusflat.h     |    1 +
 3 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 3c6f140..b5e0b03 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -208,7 +208,7 @@
 @ stub GdipFillClosedCurveI
 @ stub GdipFillEllipse
 @ stub GdipFillEllipseI
-@ stub GdipFillPath
+@ stdcall GdipFillPath(ptr ptr ptr)
 @ stdcall GdipFillPie(ptr ptr long long long long long long)
 @ stub GdipFillPieI
 @ stub GdipFillPolygon2
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index d28d76a..6123b69 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -785,6 +785,38 @@ GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics *graphics, GpPen *pen, INT x,
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipFillPath(GpGraphics *graphics, GpBrush *brush, GpPath *path)
+{
+    INT save_state;
+    GpStatus retval;
+
+    if(!brush || !graphics || !path)
+        return InvalidParameter;
+
+    save_state = SaveDC(graphics->hdc);
+    EndPath(graphics->hdc);
+    SelectObject(graphics->hdc, brush->gdibrush);
+    SetPolyFillMode(graphics->hdc, (path->fill == FillModeAlternate ? ALTERNATE
+                                                                    : WINDING));
+
+    BeginPath(graphics->hdc);
+    retval = draw_poly(graphics->hdc, NULL, path->pathdata.Points,
+                       path->pathdata.Types, path->pathdata.Count, FALSE);
+
+    if(retval != Ok)
+        goto end;
+
+    EndPath(graphics->hdc);
+    FillPath(graphics->hdc);
+
+    retval = Ok;
+
+end:
+    RestoreDC(graphics->hdc, save_state);
+
+    return retval;
+}
+
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics *graphics, GpBrush *brush, REAL x,
     REAL y, REAL width, REAL height, REAL startAngle, REAL sweepAngle)
 {
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 7f2113d..3bda290 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -44,6 +44,7 @@ GpStatus WINGDIPAPI GdipDrawLines(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
 GpStatus WINGDIPAPI GdipDrawPath(GpGraphics*,GpPen*,GpPath*);
 GpStatus WINGDIPAPI GdipDrawPie(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipDrawRectangleI(GpGraphics*,GpPen*,INT,INT,INT,INT);
+GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*);
 GpStatus WINGDIPAPI GdipFillPie(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL,REAL,REAL);
 GpStatus WINGDIPAPI GdipGetCompositingQuality(GpGraphics*,CompositingQuality*);
 GpStatus WINGDIPAPI GdipGetInterpolationMode(GpGraphics*,InterpolationMode*);




More information about the wine-cvs mailing list