From ff2e63d41edbc4be10954802946878210c13e599 Mon Sep 17 00:00:00 2001 From: Evan Stade Date: Wed, 8 Aug 2007 19:41:56 -0700 Subject: [PATCH] gdiplus: Added GdipCreatePath2. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/graphicspath.c | 30 ++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 ++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 12fda8f741d..4b507d92068 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 b11d9186855..5cfac5f32a0 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -282,6 +282,36 @@ GpStatus WINGDIPAPI GdipCreatePath(GpFillMode fill, GpPath **path) 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)->pathdata.Points); + GdipFree((*path)->pathdata.Types); + GdipFree(*path); + 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 04aa8c137da..2320c7bc89b 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -130,6 +130,8 @@ GpStatus WINGDIPAPI GdipClonePath(GpPath*,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);