static UINT32 STDMETHODCALLTYPE d2d_gradient_GetGradientStopCount(ID2D1GradientStopCollection *iface) { struct d2d_gradient *gradient = impl_from_ID2D1GradientStopCollection(iface); TRACE("iface %p.\n", iface); return gradient->stop_count; }
static void STDMETHODCALLTYPE d2d_gradient_GetFactory(ID2D1GradientStopCollection *iface, ID2D1Factory **factory) { struct d2d_gradient *gradient = impl_from_ID2D1GradientStopCollection(iface); TRACE("iface %p, factory %p.\n", iface, factory); ID2D1Factory_AddRef(*factory = gradient->factory); }
static ULONG STDMETHODCALLTYPE d2d_gradient_AddRef(ID2D1GradientStopCollection *iface) { struct d2d_gradient *gradient = impl_from_ID2D1GradientStopCollection(iface); ULONG refcount = InterlockedIncrement(&gradient->refcount); TRACE("%p increasing refcount to %u.\n", iface, refcount); return refcount; }
static void STDMETHODCALLTYPE d2d_gradient_GetGradientStops(ID2D1GradientStopCollection *iface, D2D1_GRADIENT_STOP *stops, UINT32 stop_count) { struct d2d_gradient *gradient = impl_from_ID2D1GradientStopCollection(iface); TRACE("iface %p, stops %p, stop_count %u.\n", iface, stops, stop_count); memcpy(stops, gradient->stops, min(gradient->stop_count, stop_count) * sizeof(*stops)); if (stop_count > gradient->stop_count) memset(stops, 0, (stop_count - gradient->stop_count) * sizeof(*stops)); }
static ULONG STDMETHODCALLTYPE d2d_gradient_Release(ID2D1GradientStopCollection *iface) { struct d2d_gradient *gradient = impl_from_ID2D1GradientStopCollection(iface); ULONG refcount = InterlockedDecrement(&gradient->refcount); TRACE("%p decreasing refcount to %u.\n", iface, refcount); if (!refcount) HeapFree(GetProcessHeap(), 0, gradient); return refcount; }