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

d2d1: Introduce a separate structure for fill specific geometry fields.

parent ad18f7fe
...@@ -311,6 +311,8 @@ struct d2d_geometry ...@@ -311,6 +311,8 @@ struct d2d_geometry
D2D_MATRIX_3X2_F transform; D2D_MATRIX_3X2_F transform;
struct
{
D2D1_POINT_2F *vertices; D2D1_POINT_2F *vertices;
size_t vertex_count; size_t vertex_count;
...@@ -320,6 +322,7 @@ struct d2d_geometry ...@@ -320,6 +322,7 @@ struct d2d_geometry
struct d2d_bezier *beziers; struct d2d_bezier *beziers;
size_t bezier_count; size_t bezier_count;
} fill;
union union
{ {
......
...@@ -687,11 +687,11 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target, ...@@ -687,11 +687,11 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
return; return;
} }
if (geometry->face_count) if (geometry->fill.face_count)
{ {
buffer_desc.ByteWidth = geometry->face_count * sizeof(*geometry->faces); buffer_desc.ByteWidth = geometry->fill.face_count * sizeof(*geometry->fill.faces);
buffer_desc.BindFlags = D3D10_BIND_INDEX_BUFFER; buffer_desc.BindFlags = D3D10_BIND_INDEX_BUFFER;
buffer_data.pSysMem = geometry->faces; buffer_data.pSysMem = geometry->fill.faces;
if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ib))) if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &ib)))
{ {
...@@ -699,9 +699,9 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target, ...@@ -699,9 +699,9 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
goto done; goto done;
} }
buffer_desc.ByteWidth = geometry->vertex_count * sizeof(*geometry->vertices); buffer_desc.ByteWidth = geometry->fill.vertex_count * sizeof(*geometry->fill.vertices);
buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER;
buffer_data.pSysMem = geometry->vertices; buffer_data.pSysMem = geometry->fill.vertices;
if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb))) if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb)))
{ {
...@@ -710,17 +710,17 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target, ...@@ -710,17 +710,17 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
goto done; goto done;
} }
d2d_rt_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, ib, 3 * geometry->face_count, vb, d2d_rt_draw(render_target, D2D_SHAPE_TYPE_TRIANGLE, ib, 3 * geometry->fill.face_count, vb,
sizeof(*geometry->vertices), vs_cb, ps_cb, brush, opacity_brush); sizeof(*geometry->fill.vertices), vs_cb, ps_cb, brush, opacity_brush);
ID3D10Buffer_Release(vb); ID3D10Buffer_Release(vb);
ID3D10Buffer_Release(ib); ID3D10Buffer_Release(ib);
} }
if (geometry->bezier_count) if (geometry->fill.bezier_count)
{ {
buffer_desc.ByteWidth = geometry->bezier_count * sizeof(*geometry->beziers); buffer_desc.ByteWidth = geometry->fill.bezier_count * sizeof(*geometry->fill.beziers);
buffer_data.pSysMem = geometry->beziers; buffer_data.pSysMem = geometry->fill.beziers;
if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb))) if (FAILED(hr = ID3D10Device_CreateBuffer(render_target->device, &buffer_desc, &buffer_data, &vb)))
{ {
...@@ -728,8 +728,8 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target, ...@@ -728,8 +728,8 @@ static void d2d_rt_fill_geometry(struct d2d_d3d_render_target *render_target,
goto done; goto done;
} }
d2d_rt_draw(render_target, D2D_SHAPE_TYPE_BEZIER, NULL, 3 * geometry->bezier_count, vb, d2d_rt_draw(render_target, D2D_SHAPE_TYPE_BEZIER, NULL, 3 * geometry->fill.bezier_count, vb,
sizeof(*geometry->beziers->v), vs_cb, ps_cb, brush, opacity_brush); sizeof(*geometry->fill.beziers->v), vs_cb, ps_cb, brush, opacity_brush);
ID3D10Buffer_Release(vb); ID3D10Buffer_Release(vb);
} }
......
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