[2/11] gdiplus: added GdipCreatePathGradient

Evan Stade estade at gmail.com
Thu Aug 2 19:51:53 CDT 2007


Hi,

 dlls/gdiplus/brush.c      |   40 ++++++++++++++++++++++++++++++++++++++++
 dlls/gdiplus/gdiplus.spec |    2 +-
 include/gdiplusflat.h     |    2 ++
 3 files changed, 43 insertions(+), 1 deletions(-)

-- 
Evan Stade
-------------- next part --------------
diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index 265aba0..7798e04 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -48,6 +48,43 @@ GpStatus WINGDIPAPI GdipCloneBrush(GpBru
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
+    INT count, GpWrapMode wrapMode, GpPathGradient **grad)
+{
+    COLORREF col = ARGB2COLORREF(0xffffffff);
+
+    if(!points || !grad)
+        return InvalidParameter;
+
+    *grad = GdipAlloc(sizeof(GpPathGradient));
+    if (!*grad) return OutOfMemory;
+
+    (*grad)->pathdata.Count = count;
+    (*grad)->pathdata.Points = GdipAlloc(count * sizeof(PointF));
+    (*grad)->pathdata.Types = GdipAlloc(count);
+
+    if(!(*grad)->pathdata.Points || !(*grad)->pathdata.Types){
+        GdipFree((*grad)->pathdata.Points);
+        GdipFree((*grad)->pathdata.Types);
+        GdipFree(*grad);
+        return OutOfMemory;
+    }
+
+    memcpy((*grad)->pathdata.Points, points, count * sizeof(PointF));
+    memset((*grad)->pathdata.Types, PathPointTypeLine, count);
+
+    (*grad)->brush.lb.lbStyle = BS_SOLID;
+    (*grad)->brush.lb.lbColor = col;
+    (*grad)->brush.lb.lbHatch = 0;
+
+    (*grad)->brush.gdibrush = CreateSolidBrush(col);
+    (*grad)->brush.bt = BrushTypePathGradient;
+    (*grad)->centercolor = 0xffffffff;
+    (*grad)->wrap = WrapModeClamp;
+
+    return Ok;
+}
+
 /* FIXME: path gradient brushes not truly supported (drawn as solid brushes) */
 GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
     GpPathGradient **grad)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index 87981c2..e6af5f3 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -116,7 +116,7 @@
 @ stub GdipCreatePath2
 @ stub GdipCreatePath2I
 @ stdcall GdipCreatePath(long ptr)
-@ stub GdipCreatePathGradient
+@ stdcall GdipCreatePathGradient(ptr long long ptr)
 @ stdcall GdipCreatePathGradientFromPath(ptr ptr)
 @ stub GdipCreatePathGradientI
 @ stdcall GdipCreatePathIter(ptr ptr)
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 4a90d32..fab9e0e 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -88,6 +88,8 @@ GpStatus WINGDIPAPI GdipSetSmoothingMode
 GpStatus WINGDIPAPI GdipSetWorldTransform(GpGraphics*,GpMatrix*);
 
 GpStatus WINGDIPAPI GdipCloneBrush(GpBrush*,GpBrush**);
+GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF*,INT,GpWrapMode,
+    GpPathGradient**);
 GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*,
     GpPathGradient**);
 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
-- 
1.4.1


More information about the wine-patches mailing list