gdiplus: implemented GdipFillClosedCurve2[I]
Nikolay Sivov
bunglehead at gmail.com
Thu Aug 21 17:16:49 CDT 2008
Changelog:
- Implemented GdipFillClosedCurve2/GdipFillClosedCurve2I
---
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 a00140f..9e94d57 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 3a7ffce..fe0823f 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 ed97542..c5eac71 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*);
--
1.4.4.4
More information about the wine-patches
mailing list