[10/10] gdiplus: added GdipFillPath

Evan Stade estade at gmail.com
Fri Jul 13 22:19:46 CDT 2007


On 7/13/07, Evan Stade <estade at gmail.com> wrote:
> Hi,
>
>  dlls/gdiplus/gdiplus.spec |    2 +-
>  dlls/gdiplus/graphics.c   |   33 +++++++++++++++++++++++++++++++++
>  include/gdiplusflat.h     |    1 +
>  3 files changed, 35 insertions(+), 1 deletions(-)
>
> --
> Evan Stade
>
>

Please use the attached patch instead. (The first one selects a null
pen, but FillPath doesn't use a pen so it's not necessary).

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

-- 
Evan Stade
-------------- next part --------------
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(G
     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(GpGrap
 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*);
-- 
1.4.3.4


More information about the wine-patches mailing list