d2d1: Implement d2d_solid_color_brush_SetOpacity().
This commit is contained in:
parent
fd8b3ae572
commit
743d80fea5
|
@ -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,
|
||||
|
|
|
@ -107,6 +107,8 @@ struct d2d_brush
|
|||
ID2D1Brush ID2D1Brush_iface;
|
||||
LONG refcount;
|
||||
|
||||
float opacity;
|
||||
|
||||
enum d2d_brush_type type;
|
||||
union
|
||||
{
|
||||
|
|
|
@ -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)))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue