Module: wine Branch: master Commit: d020474cb55acaee8812cb2f3b90fdee6319b4ae URL: http://source.winehq.org/git/wine.git/?a=commit;h=d020474cb55acaee8812cb2f3b...
Author: Nikolay Sivov bunglehead@gmail.com Date: Thu Jul 3 03:04:50 2008 +0400
gdiplus: Implemented GdipDrawBeziers.
---
dlls/gdiplus/gdiplus.spec | 4 +- dlls/gdiplus/graphics.c | 48 +++++++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + 3 files changed, 52 insertions(+), 2 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index d108b4e..17c1b4c 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -156,8 +156,8 @@ @ stdcall GdipDrawArcI(ptr ptr long long long long long long) @ stdcall GdipDrawBezier(ptr ptr long long long long long long long long) @ stdcall GdipDrawBezierI(ptr ptr long long long long long long long long) -@ stub GdipDrawBeziers -@ stub GdipDrawBeziersI +@ stdcall GdipDrawBeziers(ptr ptr ptr long) +@ stdcall GdipDrawBeziersI(ptr ptr ptr long) @ stub GdipDrawCachedBitmap @ stub GdipDrawClosedCurve2 @ stub GdipDrawClosedCurve2I diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index c274b2e..6c9aa15 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -997,6 +997,54 @@ GpStatus WINGDIPAPI GdipDrawBezierI(GpGraphics *graphics, GpPen *pen, INT x1, return retval; }
+GpStatus WINGDIPAPI GdipDrawBeziers(GpGraphics *graphics, GpPen *pen, + GDIPCONST GpPointF *points, INT count) +{ + INT i; + GpStatus ret; + + if(!graphics || !pen || !points || (count <= 0)) + return InvalidParameter; + + for(i = 0; i < floor(count / 4); i++){ + ret = GdipDrawBezier(graphics, pen, + points[4*i].X, points[4*i].Y, + points[4*i + 1].X, points[4*i + 1].Y, + points[4*i + 2].X, points[4*i + 2].Y, + points[4*i + 3].X, points[4*i + 3].Y); + if(ret != Ok) + return ret; + } + + return Ok; +} + +GpStatus WINGDIPAPI GdipDrawBeziersI(GpGraphics *graphics, GpPen *pen, + GDIPCONST GpPoint *points, INT count) +{ + GpPointF *pts; + GpStatus ret; + INT i; + + if(!graphics || !pen || !points || (count <= 0)) + return InvalidParameter; + + pts = GdipAlloc(sizeof(GpPointF) * count); + if(!pts) + return OutOfMemory; + + for(i = 0; i < count; i++){ + pts[i].X = (REAL)points[i].X; + pts[i].Y = (REAL)points[i].Y; + } + + ret = GdipDrawBeziers(graphics,pen,pts,count); + + GdipFree(pts); + + return ret; +} + GpStatus WINGDIPAPI GdipDrawCurve(GpGraphics *graphics, GpPen *pen, GDIPCONST GpPointF *points, INT count) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 9799296..fdcdeda 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -78,6 +78,8 @@ GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL GpStatus WINGDIPAPI GdipDrawArcI(GpGraphics*,GpPen*,INT,INT,INT,INT,REAL,REAL); GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL,REAL,REAL); 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 GdipDrawCurve(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT); GpStatus WINGDIPAPI GdipDrawCurveI(GpGraphics*,GpPen*,GDIPCONST GpPoint*,INT); GpStatus WINGDIPAPI GdipDrawCurve2(GpGraphics*,GpPen*,GDIPCONST GpPointF*,INT,REAL);