Module: wine Branch: master Commit: 48dfe437f9053001ce2c24cd5958258f3e7f74d3 URL: http://source.winehq.org/git/wine.git/?a=commit;h=48dfe437f9053001ce2c24cd59...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Sep 27 09:47:56 2017 +0200
d2d1: Implement d2d_radial_gradient_brush_GetGradientStopCollection().
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d2d1/brush.c | 11 +++++++++-- dlls/d2d1/d2d1_private.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c index 20e5b0e..f141c72 100644 --- a/dlls/d2d1/brush.c +++ b/dlls/d2d1/brush.c @@ -622,7 +622,10 @@ static ULONG STDMETHODCALLTYPE d2d_radial_gradient_brush_Release(ID2D1RadialGrad TRACE("%p decreasing refcount to %u.\n", iface, refcount);
if (!refcount) + { + ID2D1GradientStopCollection_Release(&brush->u.radial.gradient->ID2D1GradientStopCollection_iface); d2d_brush_destroy(brush); + }
return refcount; } @@ -744,9 +747,11 @@ static float STDMETHODCALLTYPE d2d_radial_gradient_brush_GetRadiusY(ID2D1RadialG static void STDMETHODCALLTYPE d2d_radial_gradient_brush_GetGradientStopCollection(ID2D1RadialGradientBrush *iface, ID2D1GradientStopCollection **gradient) { - FIXME("iface %p, gradient %p stub!\n", iface, gradient); + struct d2d_brush *brush = impl_from_ID2D1RadialGradientBrush(iface); + + TRACE("iface %p, gradient %p.\n", iface, gradient);
- *gradient = NULL; + ID2D1GradientStopCollection_AddRef(*gradient = &brush->u.radial.gradient->ID2D1GradientStopCollection_iface); }
static const struct ID2D1RadialGradientBrushVtbl d2d_radial_gradient_brush_vtbl = @@ -780,6 +785,8 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, return E_OUTOFMEMORY;
d2d_brush_init(b, factory, D2D_BRUSH_TYPE_RADIAL, brush_desc, (ID2D1BrushVtbl *)&d2d_radial_gradient_brush_vtbl); + b->u.radial.gradient = unsafe_impl_from_ID2D1GradientStopCollection(gradient); + ID2D1GradientStopCollection_AddRef(&b->u.radial.gradient->ID2D1GradientStopCollection_iface); b->u.radial.centre = gradient_desc->center; b->u.radial.offset = gradient_desc->gradientOriginOffset;
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index b0c7fed..ccff6df 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -241,6 +241,7 @@ struct d2d_brush } linear; struct { + struct d2d_gradient *gradient; D2D1_POINT_2F centre; D2D1_POINT_2F offset; } radial;