From c282f248fa2f1461db329fc2279648f957db2844 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Fri, 25 Apr 2008 22:16:36 +0400 Subject: [PATCH] gdiplus: Implemented GdipAddPathBeziersI. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphicspath.c | 25 +++++++++++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index bdead36760c..107af12a459 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -3,7 +3,7 @@ @ stdcall GdipAddPathBezier(ptr long long long long long long long long) @ stdcall GdipAddPathBezierI(ptr long long long long long long long long) @ stdcall GdipAddPathBeziers(ptr ptr long) -@ stub GdipAddPathBeziersI +@ stdcall GdipAddPathBeziersI(ptr ptr long) @ stub GdipAddPathClosedCurve2 @ stub GdipAddPathClosedCurve2I @ stub GdipAddPathClosedCurve diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 3f83beae6e2..681b7859f58 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -171,6 +171,31 @@ GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points, return Ok; } +GpStatus WINGDIPAPI GdipAddPathBeziersI(GpPath *path, GDIPCONST GpPoint *points, + INT count) +{ + GpPointF *ptsF; + GpStatus ret; + INT i; + + if(!points || ((count - 1) % 3)) + return InvalidParameter; + + ptsF = GdipAlloc(sizeof(GpPointF) * count); + if(!ptsF) + return OutOfMemory; + + for(i = 0; i < count; i++){ + ptsF[i].X = (REAL)points[i].X; + ptsF[i].Y = (REAL)points[i].Y; + } + + ret = GdipAddPathBeziers(path, ptsF, count); + GdipFree(ptsF); + + return ret; +} + GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width, REAL height) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 8df6c5b34ea..de1125ede06 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -194,6 +194,7 @@ GpStatus WINGDIPAPI GdipAddPathArcI(GpPath*,INT,INT,INT,INT,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathBezier(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathBezierI(GpPath*,INT,INT,INT,INT,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath*,GDIPCONST GpPointF*,INT); +GpStatus WINGDIPAPI GdipAddPathBeziersI(GpPath*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath*,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipAddPathEllipseI(GpPath*,INT,INT,INT,INT); GpStatus WINGDIPAPI GdipAddPathLine(GpPath*,REAL,REAL,REAL,REAL);