From 4a44100aa7b198575b552bf6ab149b6e0cd1738c Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 22 Aug 2008 02:16:49 +0400 Subject: [PATCH] gdiplus: Implemented GdipFillClosedCurve2[I]. --- dlls/gdiplus/gdiplus.spec | 4 +-- dlls/gdiplus/graphics.c | 56 +++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 5 ++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index a00140fa06..9e94d57274 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -213,8 +213,8 @@ @ stub GdipEnumerateMetafileSrcRectDestPointsI @ stub GdipEnumerateMetafileSrcRectDestRect @ stub GdipEnumerateMetafileSrcRectDestRectI -@ stub GdipFillClosedCurve2 -@ stub GdipFillClosedCurve2I +@ stdcall GdipFillClosedCurve2(ptr ptr ptr long long) +@ stdcall GdipFillClosedCurve2I(ptr ptr ptr long long) @ stub GdipFillClosedCurve @ stub GdipFillClosedCurveI @ stdcall GdipFillEllipse(ptr ptr long long long long) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 3a7ffcee7d..7bbcc747ce 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -1801,6 +1801,62 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string return Ok; } +GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics *graphics, GpBrush *brush, + GDIPCONST GpPointF *points, INT count, REAL tension, GpFillMode fill) +{ + GpPath *path; + GpStatus stat; + + if(!graphics || !brush || !points) + return InvalidParameter; + + stat = GdipCreatePath(fill, &path); + if(stat != Ok) + return stat; + + stat = GdipAddPathClosedCurve2(path, points, count, tension); + if(stat != Ok){ + GdipDeletePath(path); + return stat; + } + + stat = GdipFillPath(graphics, brush, path); + if(stat != Ok){ + GdipDeletePath(path); + return stat; + } + + GdipDeletePath(path); + + return Ok; +} + +GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics *graphics, GpBrush *brush, + GDIPCONST GpPoint *points, INT count, REAL tension, GpFillMode fill) +{ + GpPointF *ptf; + GpStatus stat; + INT i; + + if(!points || count <= 0) + return InvalidParameter; + + ptf = GdipAlloc(sizeof(GpPointF)*count); + if(!ptf) + return OutOfMemory; + + for(i = 0;i < count;i++){ + ptf[i].X = (REAL)points[i].X; + ptf[i].Y = (REAL)points[i].Y; + } + + stat = GdipFillClosedCurve2(graphics, brush, ptf, count, tension, fill); + + GdipFree(ptf); + + return stat; +} + GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics *graphics, GpBrush *brush, REAL x, REAL y, REAL width, REAL height) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index ed9754287b..c5eac719b1 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -132,6 +132,11 @@ GpStatus WINGDIPAPI GdipDrawRectanglesI(GpGraphics*,GpPen*,GDIPCONST GpRect*,INT GpStatus WINGDIPAPI GdipDrawString(GpGraphics*,GDIPCONST WCHAR*,INT, GDIPCONST GpFont*,GDIPCONST RectF*, GDIPCONST GpStringFormat*, GDIPCONST GpBrush*); + +GpStatus WINGDIPAPI GdipFillClosedCurve2(GpGraphics*,GpBrush*,GDIPCONST GpPointF*,INT, + REAL,GpFillMode); +GpStatus WINGDIPAPI GdipFillClosedCurve2I(GpGraphics*,GpBrush*,GDIPCONST GpPoint*,INT, + REAL,GpFillMode); GpStatus WINGDIPAPI GdipFillEllipse(GpGraphics*,GpBrush*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipFillEllipseI(GpGraphics*,GpBrush*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipFillPath(GpGraphics*,GpBrush*,GpPath*); -- 2.32.0.93.g670b81a890