gdiplus: implemeted GdipGetPathGradientBlendCount with test.
diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c
index ba7663e..86740fe 100644
--- a/dlls/gdiplus/brush.c
+++ b/dlls/gdiplus/brush.c
@@ -75,6 +75,24 @@
memcpy(dest->pathdata.Points, src->pathdata.Points, count * sizeof(PointF));
memcpy(dest->pathdata.Types, src->pathdata.Types, count);
+ /* blending */
+ count = src->blendcount;
+ dest->blendcount = count;
+ dest->blendfac = GdipAlloc(count * sizeof(REAL));
+ dest->blendpos = GdipAlloc(count * sizeof(REAL));
+
+ if(!dest->blendfac || !dest->blendpos){
+ GdipFree(dest->pathdata.Points);
+ GdipFree(dest->pathdata.Types);
+ GdipFree(dest->blendfac);
+ GdipFree(dest->blendpos);
+ GdipFree(dest);
+ return OutOfMemory;
+ }
+
+ memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
+ memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
+
break;
}
case BrushTypeLinearGradient:
@@ -213,6 +231,15 @@
*grad = GdipAlloc(sizeof(GpPathGradient));
if (!*grad) return OutOfMemory;
+ (*grad)->blendfac = GdipAlloc(sizeof(REAL));
+ if(!(*grad)->blendfac){
+ GdipFree(*grad);
+ return OutOfMemory;
+ }
+ (*grad)->blendfac[0] = 1.0;
+ (*grad)->blendpos = NULL;
+ (*grad)->blendcount = 1;
+
(*grad)->pathdata.Count = count;
(*grad)->pathdata.Points = GdipAlloc(count * sizeof(PointF));
(*grad)->pathdata.Types = GdipAlloc(count);
@@ -284,6 +311,15 @@
*grad = GdipAlloc(sizeof(GpPathGradient));
if (!*grad) return OutOfMemory;
+ (*grad)->blendfac = GdipAlloc(sizeof(REAL));
+ if(!(*grad)->blendfac){
+ GdipFree(*grad);
+ return OutOfMemory;
+ }
+ (*grad)->blendfac[0] = 1.0;
+ (*grad)->blendpos = NULL;
+ (*grad)->blendcount = 1;
+
(*grad)->pathdata.Count = path->pathdata.Count;
(*grad)->pathdata.Points = GdipAlloc(path->pathdata.Count * sizeof(PointF));
(*grad)->pathdata.Types = GdipAlloc(path->pathdata.Count);
@@ -476,6 +512,8 @@
case BrushTypePathGradient:
GdipFree(((GpPathGradient*) brush)->pathdata.Points);
GdipFree(((GpPathGradient*) brush)->pathdata.Types);
+ GdipFree(((GpPathGradient*) brush)->blendfac);
+ GdipFree(((GpPathGradient*) brush)->blendpos);
break;
case BrushTypeSolidColor:
case BrushTypeLinearGradient:
@@ -511,6 +549,16 @@
return Ok;
}
+GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(GpPathGradient *brush, INT *count)
+{
+ if(!brush || !count)
+ return InvalidParameter;
+
+ *count = brush->blendcount;
+
+ return Ok;
+}
+
GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad,
GpPointF *point)
{