Evan Stade : gdiplus: Added GdipAddPathEllipse.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Jul 26 06:37:26 CDT 2007
Module: wine
Branch: master
Commit: fe2ce3a08b61f5629181148e53d4ec39b58ced1c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fe2ce3a08b61f5629181148e53d4ec39b58ced1c
Author: Evan Stade <estade at gmail.com>
Date: Wed Jul 25 19:15:24 2007 -0700
gdiplus: Added GdipAddPathEllipse.
---
dlls/gdiplus/gdiplus.spec | 2 +-
dlls/gdiplus/graphicspath.c | 30 ++++++++++++++++++++++++++++++
include/gdiplusflat.h | 1 +
3 files changed, 32 insertions(+), 1 deletions(-)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 74ba047..02b1e18 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -14,7 +14,7 @@
@ stub GdipAddPathCurve3I
@ stub GdipAddPathCurve
@ stub GdipAddPathCurveI
-@ stub GdipAddPathEllipse
+@ stdcall GdipAddPathEllipse(ptr long long long long)
@ stub GdipAddPathEllipseI
@ stdcall GdipAddPathLine2(ptr ptr long)
@ stub GdipAddPathLine2I
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index d059482..4fe99e0 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -121,6 +121,36 @@ GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath *path, GDIPCONST GpPointF *points,
return Ok;
}
+GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath *path, REAL x, REAL y, REAL width,
+ REAL height)
+{
+ INT old_count, numpts;
+
+ if(!path)
+ return InvalidParameter;
+
+ if(!lengthen_path(path, MAX_ARC_PTS))
+ return OutOfMemory;
+
+ old_count = path->pathdata.Count;
+ if((numpts = arc2polybezier(&path->pathdata.Points[old_count], x, y, width,
+ height, 0.0, 360.0)) != MAX_ARC_PTS){
+ ERR("expected %d points but got %d\n", MAX_ARC_PTS, numpts);
+ return GenericError;
+ }
+
+ memset(&path->pathdata.Types[old_count + 1], PathPointTypeBezier,
+ MAX_ARC_PTS - 1);
+
+ /* An ellipse is an instrinsic figure (always its own subpath). */
+ path->pathdata.Types[old_count] = PathPointTypeStart;
+ path->pathdata.Types[old_count + MAX_ARC_PTS - 1] |= PathPointTypeCloseSubpath;
+ path->newfigure = TRUE;
+ path->pathdata.Count += MAX_ARC_PTS;
+
+ return Ok;
+}
+
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath *path, GDIPCONST GpPointF *points,
INT count)
{
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 816f32d..d56c45c 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -89,6 +89,7 @@ GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill*,ARGB);
GpStatus WINGDIPAPI GdipAddPathArc(GpPath*,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipAddPathBeziers(GpPath*,GDIPCONST GpPointF*,INT);
+GpStatus WINGDIPAPI GdipAddPathEllipse(GpPath*,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipAddPathLine2(GpPath*,GDIPCONST GpPointF*,INT);
GpStatus WINGDIPAPI GdipAddPathPath(GpPath*,GDIPCONST GpPath*,BOOL);
GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);
More information about the wine-cvs
mailing list