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

d2d1: Unify the outline and fill pixel shaders.

parent 2fafd92d
......@@ -846,25 +846,26 @@ static BOOL d2d_brush_fill_cb(const struct d2d_brush *brush,
}
HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush,
struct d2d_d3d_render_target *render_target, ID3D10Buffer **ps_cb)
BOOL outline, struct d2d_d3d_render_target *render_target, ID3D10Buffer **ps_cb)
{
struct d2d_brush_cb brush_cb[2] = {{0}};
D3D10_SUBRESOURCE_DATA buffer_data;
struct d2d_ps_cb cb_data = {0};
D3D10_BUFFER_DESC buffer_desc;
HRESULT hr;
if (!d2d_brush_fill_cb(brush, render_target, &brush_cb[0]))
cb_data.outline = outline;
if (!d2d_brush_fill_cb(brush, render_target, &cb_data.colour_brush))
return E_NOTIMPL;
if (!d2d_brush_fill_cb(opacity_brush, render_target, &brush_cb[1]))
if (!d2d_brush_fill_cb(opacity_brush, render_target, &cb_data.opacity_brush))
return E_NOTIMPL;
buffer_desc.ByteWidth = sizeof(brush_cb);
buffer_desc.ByteWidth = sizeof(cb_data);
buffer_desc.Usage = D3D10_USAGE_DEFAULT;
buffer_desc.BindFlags = D3D10_BIND_CONSTANT_BUFFER;
buffer_desc.CPUAccessFlags = 0;
buffer_desc.MiscFlags = 0;
buffer_data.pSysMem = brush_cb;
buffer_data.pSysMem = &cb_data;
buffer_data.SysMemPitch = 0;
buffer_data.SysMemSlicePitch = 0;
......
......@@ -68,7 +68,6 @@ struct d2d_shape_resources
{
ID3D10InputLayout *il;
ID3D10VertexShader *vs;
ID3D10PixelShader *ps;
};
struct d2d_brush_cb
......@@ -91,6 +90,14 @@ struct d2d_brush_cb
} u;
};
struct d2d_ps_cb
{
BOOL outline;
BOOL pad[3];
struct d2d_brush_cb colour_brush;
struct d2d_brush_cb opacity_brush;
};
struct d2d_d3d_render_target
{
ID2D1RenderTarget ID2D1RenderTarget_iface;
......@@ -105,6 +112,7 @@ struct d2d_d3d_render_target
ID3D10RenderTargetView *view;
ID3D10StateBlock *stateblock;
struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT];
ID3D10PixelShader *ps;
ID3D10Buffer *ib;
unsigned int vb_stride;
ID3D10Buffer *vb;
......@@ -241,7 +249,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEA
HRESULT d2d_bitmap_brush_create(ID2D1Factory *factory, ID2D1Bitmap *bitmap, const D2D1_BITMAP_BRUSH_PROPERTIES *bitmap_brush_desc,
const D2D1_BRUSH_PROPERTIES *brush_desc, struct d2d_brush **brush) DECLSPEC_HIDDEN;
void d2d_brush_bind_resources(struct d2d_brush *brush, ID3D10Device *device, unsigned int brush_idx) DECLSPEC_HIDDEN;
HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush,
HRESULT d2d_brush_get_ps_cb(struct d2d_brush *brush, struct d2d_brush *opacity_brush, BOOL outline,
struct d2d_d3d_render_target *render_target, ID3D10Buffer **ps_cb) DECLSPEC_HIDDEN;
struct d2d_brush *unsafe_impl_from_ID2D1Brush(ID2D1Brush *iface) DECLSPEC_HIDDEN;
......
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