From 48dfe437f9053001ce2c24cd5958258f3e7f74d3 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 27 Sep 2017 09:47:56 +0200 Subject: [PATCH] d2d1: Implement d2d_radial_gradient_brush_GetGradientStopCollection(). Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- 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 20e5b0e7fda..f141c72dd41 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); - *gradient = NULL; + TRACE("iface %p, gradient %p.\n", iface, gradient); + + 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 b0c7fede38b..ccff6df8ea4 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;