d2d1: Implement d2d_solid_color_brush_SetOpacity().

This commit is contained in:
Henri Verbeet 2014-11-06 08:20:17 +01:00 committed by Alexandre Julliard
parent fd8b3ae572
commit 743d80fea5
3 changed files with 17 additions and 3 deletions

View File

@ -149,6 +149,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1RenderTarget *render_ta
{
brush->ID2D1Brush_iface.lpVtbl = vtbl;
brush->refcount = 1;
brush->opacity = desc ? desc->opacity : 1.0f;
brush->type = type;
}
@ -210,7 +211,11 @@ static void STDMETHODCALLTYPE d2d_solid_color_brush_GetFactory(ID2D1SolidColorBr
static void STDMETHODCALLTYPE d2d_solid_color_brush_SetOpacity(ID2D1SolidColorBrush *iface, float opacity)
{
FIXME("iface %p, opacity %.8e stub!\n", iface, opacity);
struct d2d_brush *brush = impl_from_ID2D1SolidColorBrush(iface);
TRACE("iface %p, opacity %.8e.\n", iface, opacity);
brush->opacity = opacity;
}
static void STDMETHODCALLTYPE d2d_solid_color_brush_SetTransform(ID2D1SolidColorBrush *iface,

View File

@ -107,6 +107,8 @@ struct d2d_brush
ID2D1Brush ID2D1Brush_iface;
LONG refcount;
float opacity;
enum d2d_brush_type type;
union
{

View File

@ -501,6 +501,7 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
D3D10_SUBRESOURCE_DATA buffer_data;
D3D10_BUFFER_DESC buffer_desc;
ID3D10Buffer *vs_cb, *ps_cb;
D2D1_COLOR_F color;
float tmp_x, tmp_y;
HRESULT hr;
struct
@ -558,8 +559,14 @@ static void STDMETHODCALLTYPE d2d_d3d_render_target_FillRectangle(ID2D1RenderTar
return;
}
buffer_desc.ByteWidth = sizeof(brush_impl->u.solid.color);
buffer_data.pSysMem = &brush_impl->u.solid.color;
color = brush_impl->u.solid.color;
color.r *= brush_impl->opacity;
color.g *= brush_impl->opacity;
color.b *= brush_impl->opacity;
color.a *= brush_impl->opacity;
buffer_desc.ByteWidth = sizeof(color);
buffer_data.pSysMem = &color;
if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ps_cb)))
{