d2d1: Fix the segment count for open figures.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2017-06-07 21:31:53 +02:00 committed by Alexandre Julliard
parent 09ff685aa0
commit 4dcdc80ad5
2 changed files with 4 additions and 1 deletions

View File

@ -2105,7 +2105,6 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
}
geometry->u.path.state = D2D_GEOMETRY_STATE_FIGURE;
++geometry->u.path.segment_count;
}
static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *iface,
@ -2196,6 +2195,7 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_EndFigure(ID2D1GeometrySink *ifa
figure->vertex_types[figure->vertex_count - 1] = D2D_VERTEX_TYPE_LINE;
if (figure_end == D2D1_FIGURE_END_CLOSED)
{
++geometry->u.path.segment_count;
figure->flags |= D2D_FIGURE_FLAG_CLOSED;
if (!memcmp(&figure->vertices[0], &figure->vertices[figure->vertex_count - 1], sizeof(*figure->vertices)))
--figure->vertex_count;

View File

@ -2528,6 +2528,9 @@ static void test_path_geometry(void)
hr = ID2D1GeometrySink_Close(sink);
ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
ID2D1GeometrySink_Release(sink);
hr = ID2D1PathGeometry_GetSegmentCount(geometry, &count);
ok(SUCCEEDED(hr), "Failed to get segment count, hr %#x.\n", hr);
ok(count == 2, "Got unexpected segment count %u.\n", count);
geometry_sink_init(&simplify_sink);
hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,