[1/7] gdiplus: added GdipCreatePath2

Evan Stade estade at gmail.com
Wed Aug 8 21:41:56 CDT 2007


Hi,

this patch and the next one together fix bug 9242

 dlls/gdiplus/gdiplus.spec   |    2 +-
 dlls/gdiplus/graphicspath.c |   30 ++++++++++++++++++++++++++++++
 include/gdiplusflat.h       |    2 ++
 3 files changed, 33 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 12fda8f..4b507d9 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -113,7 +113,7 @@
 @ stub GdipCreateMetafileFromStream
 @ stdcall GdipCreateMetafileFromWmf(ptr long ptr ptr)
 @ stub GdipCreateMetafileFromWmfFile
-@ stub GdipCreatePath2
+@ stdcall GdipCreatePath2(ptr ptr long long ptr)
 @ stub GdipCreatePath2I
 @ stdcall GdipCreatePath(long ptr)
 @ stdcall GdipCreatePathGradient(ptr long long ptr)
diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c
index b11d918..d98a229 100644
--- a/dlls/gdiplus/graphicspath.c
+++ b/dlls/gdiplus/graphicspath.c
@@ -282,6 +282,36 @@ GpStatus WINGDIPAPI GdipCreatePath(GpFil
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF* points,
+    GDIPCONST BYTE* types, INT count, GpFillMode fill, GpPath **path)
+{
+    if(!path)
+        return InvalidParameter;
+
+    *path = GdipAlloc(sizeof(GpPath));
+    if(!*path)  return OutOfMemory;
+
+    (*path)->pathdata.Points = GdipAlloc(count * sizeof(PointF));
+    (*path)->pathdata.Types = GdipAlloc(count);
+
+    if(!(*path)->pathdata.Points || !(*path)->pathdata.Types){
+        GdipFree(*path);
+        GdipFree((*path)->pathdata.Points);
+        GdipFree((*path)->pathdata.Types);
+        return OutOfMemory;
+    }
+
+    memcpy((*path)->pathdata.Points, points, count * sizeof(PointF));
+    memcpy((*path)->pathdata.Types, types, count);
+    (*path)->pathdata.Count = count;
+    (*path)->datalen = count;
+
+    (*path)->fill = fill;
+    (*path)->newfigure = TRUE;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipDeletePath(GpPath *path)
 {
     if(!path)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 04aa8c1..2320c7b 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -130,6 +130,8 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath
 GpStatus WINGDIPAPI GdipClosePathFigure(GpPath*);
 GpStatus WINGDIPAPI GdipClosePathFigures(GpPath*);
 GpStatus WINGDIPAPI GdipCreatePath(GpFillMode,GpPath**);
+GpStatus WINGDIPAPI GdipCreatePath2(GDIPCONST GpPointF*,GDIPCONST BYTE*,INT,
+    GpFillMode,GpPath**);
 GpStatus WINGDIPAPI GdipDeletePath(GpPath*);
 GpStatus WINGDIPAPI GdipFillPolygon(GpGraphics*,GpBrush*,GDIPCONST GpPointF*,
     INT,GpFillMode);
-- 
1.4.1


More information about the wine-patches mailing list