Commit 44823244 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d2d1: Implement d2d_radial_gradient_brush_GetCenter().

parent 19e72fe1
......@@ -700,9 +700,11 @@ static void STDMETHODCALLTYPE d2d_radial_gradient_brush_SetRadiusY(ID2D1RadialGr
static D2D1_POINT_2F * STDMETHODCALLTYPE d2d_radial_gradient_brush_GetCenter(ID2D1RadialGradientBrush *iface,
D2D1_POINT_2F *centre)
{
FIXME("iface %p, centre %p stub!\n", iface, centre);
struct d2d_brush *brush = impl_from_ID2D1RadialGradientBrush(iface);
TRACE("iface %p, centre %p.\n", iface, centre);
d2d_point_set(centre, 0.0f, 0.0f);
*centre = brush->u.radial.centre;
return centre;
}
......@@ -758,7 +760,8 @@ static const struct ID2D1RadialGradientBrushVtbl d2d_radial_gradient_brush_vtbl
d2d_radial_gradient_brush_GetGradientStopCollection,
};
HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, const D2D1_BRUSH_PROPERTIES *brush_desc,
HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
ID2D1GradientStopCollection *gradient, struct d2d_brush **brush)
{
struct d2d_brush *b;
......@@ -767,6 +770,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, const D2D1_BRUSH
return E_OUTOFMEMORY;
d2d_brush_init(b, factory, D2D_BRUSH_TYPE_RADIAL, brush_desc, (ID2D1BrushVtbl *)&d2d_radial_gradient_brush_vtbl);
b->u.radial.centre = gradient_desc->center;
TRACE("Created brush %p.\n", b);
*brush = b;
......
......@@ -241,6 +241,10 @@ struct d2d_brush
} linear;
struct
{
D2D1_POINT_2F centre;
} radial;
struct
{
struct d2d_bitmap *bitmap;
D2D1_EXTEND_MODE extend_mode_x;
D2D1_EXTEND_MODE extend_mode_y;
......@@ -255,7 +259,8 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
const D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
ID2D1GradientStopCollection *gradient, struct d2d_brush **brush) DECLSPEC_HIDDEN;
HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, const D2D1_BRUSH_PROPERTIES *brush_desc,
HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
const D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES *gradient_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
ID2D1GradientStopCollection *gradient, struct d2d_brush **brush) DECLSPEC_HIDDEN;
HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap,
const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc, const D2D1_BRUSH_PROPERTIES *brush_desc,
......
......@@ -417,7 +417,7 @@ static HRESULT STDMETHODCALLTYPE d2d_d3d_render_target_CreateRadialGradientBrush
iface, gradient_brush_desc, brush_desc, gradient, brush);
if (SUCCEEDED(hr = d2d_radial_gradient_brush_create(render_target->factory,
brush_desc, gradient, &object)))
gradient_brush_desc, brush_desc, gradient, &object)))
*brush = (ID2D1RadialGradientBrush *)&object->ID2D1Brush_iface;
return hr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment