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:
parent
09ff685aa0
commit
4dcdc80ad5
|
@ -2105,7 +2105,6 @@ static void STDMETHODCALLTYPE d2d_geometry_sink_BeginFigure(ID2D1GeometrySink *i
|
||||||
}
|
}
|
||||||
|
|
||||||
geometry->u.path.state = D2D_GEOMETRY_STATE_FIGURE;
|
geometry->u.path.state = D2D_GEOMETRY_STATE_FIGURE;
|
||||||
++geometry->u.path.segment_count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void STDMETHODCALLTYPE d2d_geometry_sink_AddLines(ID2D1GeometrySink *iface,
|
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;
|
figure->vertex_types[figure->vertex_count - 1] = D2D_VERTEX_TYPE_LINE;
|
||||||
if (figure_end == D2D1_FIGURE_END_CLOSED)
|
if (figure_end == D2D1_FIGURE_END_CLOSED)
|
||||||
{
|
{
|
||||||
|
++geometry->u.path.segment_count;
|
||||||
figure->flags |= D2D_FIGURE_FLAG_CLOSED;
|
figure->flags |= D2D_FIGURE_FLAG_CLOSED;
|
||||||
if (!memcmp(&figure->vertices[0], &figure->vertices[figure->vertex_count - 1], sizeof(*figure->vertices)))
|
if (!memcmp(&figure->vertices[0], &figure->vertices[figure->vertex_count - 1], sizeof(*figure->vertices)))
|
||||||
--figure->vertex_count;
|
--figure->vertex_count;
|
||||||
|
|
|
@ -2528,6 +2528,9 @@ static void test_path_geometry(void)
|
||||||
hr = ID2D1GeometrySink_Close(sink);
|
hr = ID2D1GeometrySink_Close(sink);
|
||||||
ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
|
||||||
ID2D1GeometrySink_Release(sink);
|
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);
|
geometry_sink_init(&simplify_sink);
|
||||||
hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
|
hr = ID2D1PathGeometry_Simplify(geometry, D2D1_GEOMETRY_SIMPLIFICATION_OPTION_LINES,
|
||||||
|
|
Loading…
Reference in New Issue