Commit 2fafd92d authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d2d1: Unify the various brush pixel shaders.

Branches inside shaders aren't free, but in the long term avoiding switching between shaders is probably worth it for D2D. As an added benefit, this makes bitmap brushes and opacity brushes work with bezier geometry. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 49019368
......@@ -68,7 +68,27 @@ struct d2d_shape_resources
{
ID3D10InputLayout *il;
ID3D10VertexShader *vs;
ID3D10PixelShader *ps[D2D_BRUSH_TYPE_COUNT][D2D_BRUSH_TYPE_COUNT + 1];
ID3D10PixelShader *ps;
};
struct d2d_brush_cb
{
enum d2d_brush_type type;
float opacity;
unsigned int pad[2];
union
{
struct
{
D2D1_COLOR_F colour;
} solid;
struct
{
float _11, _21, _31, pad;
float _12, _22, _32;
BOOL ignore_alpha;
} bitmap;
} u;
};
struct d2d_d3d_render_target
......@@ -220,8 +240,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEA
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, struct d2d_brush **brush) DECLSPEC_HIDDEN;
void d2d_brush_bind_resources(struct d2d_brush *brush, struct d2d_brush *opacity_brush,
struct d2d_d3d_render_target *render_target, enum d2d_shape_type shape_type) 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,
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