Evan Stade : gdiplus: Added GdipGetPathGradientPointCount.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Aug 3 08:04:46 CDT 2007


Module: wine
Branch: master
Commit: 490ca1cabb6d0fb75e1829e7e6d9fbd2fa9dccfd
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=490ca1cabb6d0fb75e1829e7e6d9fbd2fa9dccfd

Author: Evan Stade <estade at gmail.com>
Date:   Thu Aug  2 17:51:49 2007 -0700

gdiplus: Added GdipGetPathGradientPointCount.

---

 dlls/gdiplus/brush.c           |   28 +++++++++++++++++++++++++++-
 dlls/gdiplus/gdiplus.spec      |    2 +-
 dlls/gdiplus/gdiplus_private.h |    1 +
 include/gdiplusflat.h          |    1 +
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index dbe221c..265aba0 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -60,12 +60,27 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
     *grad = GdipAlloc(sizeof(GpPathGradient));
     if (!*grad) return OutOfMemory;
 
+    (*grad)->pathdata.Count = path->pathdata.Count;
+    (*grad)->pathdata.Points = GdipAlloc(path->pathdata.Count * sizeof(PointF));
+    (*grad)->pathdata.Types = GdipAlloc(path->pathdata.Count);
+
+    if(!(*grad)->pathdata.Points || !(*grad)->pathdata.Types){
+        GdipFree((*grad)->pathdata.Points);
+        GdipFree((*grad)->pathdata.Types);
+        GdipFree(*grad);
+        return OutOfMemory;
+    }
+
+    memcpy((*grad)->pathdata.Points, path->pathdata.Points,
+           path->pathdata.Count * sizeof(PointF));
+    memcpy((*grad)->pathdata.Types, path->pathdata.Types, path->pathdata.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 = BrushTypeSolidColor;
+    (*grad)->brush.bt = BrushTypePathGradient;
     (*grad)->centercolor = 0xffffffff;
     (*grad)->wrap = WrapModeClamp;
 
@@ -111,6 +126,17 @@ GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
     return Ok;
 }
 
+GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient *grad,
+    INT *count)
+{
+    if(!grad || !count)
+        return InvalidParameter;
+
+    *count = grad->pathdata.Count;
+
+    return Ok;
+}
+
 GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
 {
     if(!sf || !argb)
diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec
index f92c18c..dba0b24 100644
--- a/dlls/gdiplus/gdiplus.spec
+++ b/dlls/gdiplus/gdiplus.spec
@@ -333,7 +333,7 @@
 @ stub GdipGetPathGradientFocusScales
 @ stub GdipGetPathGradientGammaCorrection
 @ stub GdipGetPathGradientPath
-@ stub GdipGetPathGradientPointCount
+@ stdcall GdipGetPathGradientPointCount(ptr ptr)
 @ stub GdipGetPathGradientPresetBlend
 @ stub GdipGetPathGradientPresetBlendCount
 @ stub GdipGetPathGradientRect
diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h
index ee120d9..1c59a59 100644
--- a/dlls/gdiplus/gdiplus_private.h
+++ b/dlls/gdiplus/gdiplus_private.h
@@ -94,6 +94,7 @@ struct GpSolidFill{
 
 struct GpPathGradient{
     GpBrush brush;
+    PathData pathdata;
     ARGB centercolor;
     GpWrapMode wrap;
 };
diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h
index 83aea93..4a90d32 100644
--- a/include/gdiplusflat.h
+++ b/include/gdiplusflat.h
@@ -92,6 +92,7 @@ GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath*,
     GpPathGradient**);
 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB,GpSolidFill**);
 GpStatus WINGDIPAPI GdipGetBrushType(GpBrush*,GpBrushType*);
+GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient*,INT*);
 GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush*);
 GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill*,ARGB*);
 GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient*,ARGB);




More information about the wine-cvs mailing list