d2d1: Implement d2d_radial_gradient_brush_GetCenter().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-09-27 09:47:52 +02:00 committed by Alexandre Julliard
parent 19e72fe149
commit 4482324455
3 changed files with 14 additions and 5 deletions

View File

@ -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);
d2d_point_set(centre, 0.0f, 0.0f);
TRACE("iface %p, centre %p.\n", iface, centre);
*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;

View File

@ -240,6 +240,10 @@ struct d2d_brush
D2D1_POINT_2F end;
} linear;
struct
{
D2D1_POINT_2F centre;
} radial;
struct
{
struct d2d_bitmap *bitmap;
D2D1_EXTEND_MODE extend_mode_x;
@ -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,

View File

@ -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;