From: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> --- dlls/d2d1/tests/d2d1.c | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 6ae1f65a24b..331821fe2b2 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -11432,6 +11432,9 @@ static void test_geometry_group(BOOL d3d11) ID2D1Geometry *geometries[2]; ID2D1GeometryGroup *group; D2D1_MATRIX_3X2_F matrix; + ID2D1PathGeometry *path; + ID2D1GeometrySink *sink; + D2D1_POINT_2F point; D2D1_RECT_F rect; HRESULT hr; BOOL match; @@ -11471,6 +11474,51 @@ static void test_geometry_group(BOOL d3d11) ID2D1Geometry_Release(geometries[0]); ID2D1Geometry_Release(geometries[1]); + /* Empty path. */ + hr = ID2D1Factory_CreatePathGeometry(ctx.factory, &path); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + hr = ID2D1Factory_CreateGeometryGroup(ctx.factory, D2D1_FILL_MODE_ALTERNATE, (ID2D1Geometry **)&path, 1, &group); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1GeometryGroup_GetBounds(group, NULL, &rect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + match = compare_rect(&rect, INFINITY, INFINITY, FLT_MAX, FLT_MAX, 0); + todo_wine + ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n", + rect.left, rect.top, rect.right, rect.bottom); + + hr = ID2D1PathGeometry_Open(path, &sink); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + + set_point(&point, 160.0f, 240.0f); + ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_FILLED); + line_to(sink, 240.0f, 240.0f); + line_to(sink, 240.0f, 720.0f); + line_to(sink, 160.0f, 720.0f); + ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN); + ID2D1GeometrySink_Close(sink); + ID2D1GeometrySink_Release(sink); + + hr = ID2D1GeometryGroup_GetBounds(group, NULL, &rect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + match = compare_rect(&rect, INFINITY, INFINITY, FLT_MAX, FLT_MAX, 0); + todo_wine + ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n", + rect.left, rect.top, rect.right, rect.bottom); + + ID2D1GeometryGroup_Release(group); + + hr = ID2D1Factory_CreateGeometryGroup(ctx.factory, D2D1_FILL_MODE_ALTERNATE, (ID2D1Geometry **)&path, 1, &group); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + hr = ID2D1GeometryGroup_GetBounds(group, NULL, &rect); + ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); + match = compare_rect(&rect, 160.0f, 240.0f, 240.0f, 720.0f, 0); + ok(match, "Got unexpected rectangle {%.8e, %.8e, %.8e, %.8e}.\n", + rect.left, rect.top, rect.right, rect.bottom); + + ID2D1GeometryGroup_Release(group); + ID2D1PathGeometry_Release(path); + release_test_context(&ctx); } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10043