Nikolay Sivov : gdiplus: Implemeted GdipDrawClosedCurve2 and GdipDrawClosedCurve2I.
Alexandre Julliard
julliard at winehq.org
Wed Jul 9 06:10:04 CDT 2008
Module: wine
Branch: master
Commit: 8b8864b727671eadd942a8978885efe8b807a9f5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=8b8864b727671eadd942a8978885efe8b807a9f5
Author: Nikolay Sivov <bunglehead at gmail.com>
Date: Wed Jul 9 00:39:19 2008 +0400
gdiplus: Implemeted GdipDrawClosedCurve2 and GdipDrawClosedCurve2I.
---
dlls/gdiplus/gdiplus.spec | 4 +-
dlls/gdiplus/graphics.c | 51 +++++++++++++++++++++++++++++++++++++++++++++
include/gdiplusflat.h | 2 +
3 files changed, 55 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index a1c4849..9b272eb 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -159,8 +159,8 @@
@ stdcall GdipDrawBeziers(ptr ptr ptr long)
@ stdcall GdipDrawBeziersI(ptr ptr ptr long)
@ stub GdipDrawCachedBitmap
-@ stub GdipDrawClosedCurve2
-@ stub GdipDrawClosedCurve2I
+@ stdcall GdipDrawClosedCurve2(ptr ptr ptr long long)
+@ stdcall GdipDrawClosedCurve2I(ptr ptr ptr long long)
@ stub GdipDrawClosedCurve
@ stub GdipDrawClosedCurveI
@ stdcall GdipDrawCurve2(ptr ptr ptr long long)
diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c
index 6c9aa15..0f82404 100644
--- a/dlls/gdiplus/graphics.c
+++ b/dlls/gdiplus/graphics.c
@@ -1045,6 +1045,57 @@ GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen,
return ret;
}
+GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPointF *points, INT count, REAL tension)
+{
+ GpPointF *ptf;
+ GpStatus stat;
+
+ if(!graphics || !pen || !points || count <= 0)
+ return InvalidParameter;
+
+ /* make a full points copy.. */
+ ptf = GdipAlloc(sizeof(GpPointF)*(count+1));
+ if(!ptf)
+ return OutOfMemory;
+ memcpy(ptf, points, sizeof(GpPointF)*count);
+
+ /* ..and add a first point as a last one */
+ ptf[count] = ptf[0];
+
+ stat = GdipDrawCurve2(graphics, pen, ptf, count + 1, tension);
+
+ GdipFree(ptf);
+
+ return stat;
+}
+
+GpStatus WINGDIPAPI GdipDrawClosedCurve2I(GpGraphics *graphics, GpPen *pen,
+ GDIPCONST GpPoint *points, INT count, REAL tension)
+{
+ 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 = GdipDrawClosedCurve2(graphics, pen, ptf, count, tension);
+
+ GdipFree(ptf);
+
+ return stat;
+}
+
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen,
GDIPCONST GpPointF *points, INT count)
{
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 3deca53..7538165 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -85,6 +85,8 @@ GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,R
GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics*,GpPen*,INT,INT,INT,INT,INT,INT,INT,INT);
GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT);
+GpStatus WINGDIPAPI GdipDrawClosedCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL);
+GpStatus WINGDIPAPI GdipDrawClosedCurve2I(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT,REAL);
GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT);
GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT);
GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL);
More information about the wine-cvs
mailing list