File 0002-d2d1-tests-Add-test-for-single-quadratic-bezier-segm.patch of Package wine
From dc7af21917554fd253bdd9d763f6e10009cba8d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
Date: Thu, 6 Jan 2022 06:54:14 +0100
Subject: [PATCH 02/10] d2d1/tests: Add test for single quadratic bezier
segment
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Extra test for outline generation code, path with only 2 vertices.
Signed-off-by: Stefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>
---
dlls/d2d1/tests/d2d1.c | 39 +++++++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 2d9bcfc892e..efa4bf488e1 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -6879,6 +6879,45 @@ static void test_draw_geometry(BOOL d3d11)
"AiWaAiScAiKdAiGeAh+hAhyjAhmuAg3GxgEA");
ok(match, "Figure does not match.\n");
+ hr = ID2D1Factory_CreatePathGeometry(factory, &geometry);
+ ok(SUCCEEDED(hr), "Failed to create path geometry, hr %#x.\n", hr);
+ hr = ID2D1PathGeometry_Open(geometry, &sink);
+ ok(SUCCEEDED(hr), "Failed to open geometry sink, hr %#x.\n", hr);
+
+ set_point(&point, 20.0f, 80.0f);
+ ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
+ quadratic_to(sink, 20.0f, 160.0f, 60.0f, 160.0f);
+ ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED);
+
+ set_point(&point, 100.0f, 80.0f);
+ ID2D1GeometrySink_BeginFigure(sink, point, D2D1_FIGURE_BEGIN_HOLLOW);
+ quadratic_to(sink, 100.0f, 160.0f, 140.0f, 160.0f);
+ ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_OPEN);
+
+ hr = ID2D1GeometrySink_Close(sink);
+ ok(SUCCEEDED(hr), "Failed to close geometry sink, hr %#x.\n", hr);
+ ID2D1GeometrySink_Release(sink);
+
+ ID2D1RenderTarget_BeginDraw(rt);
+ ID2D1RenderTarget_Clear(rt, &color);
+ ID2D1RenderTarget_DrawGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, 10.0f, NULL);
+ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
+ ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+ ID2D1PathGeometry_Release(geometry);
+
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 17,
+ "3iUCngEEnAEGmgEImAEKlgEMlAEOkgEQkAESjgEUjAEWigEYiAEahgEchAEeggEggQEhfyN9JXsn"
+ "eih4KnYUAhZ1FAMWcxQFFnIUBhZwFQcWbxQJFm4UChZsFQsWaxUMFmoVDRZpFQ4WaBUPFmcVEBZm"
+ "FREWZhURFmUVEhZkFhIWZBYSFmQXERZkFxEWZBgQFmQaDhZlGwwWZh0JFmchBBZpOWw2bzN0Lnsn"
+ "2mEA");
+ ok(match, "Figure does not match.\n");
+
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 24,
+ "njIUjAEUjAEUjAEUjAEUjAEUjQEUjAEUjAEUjAEUjQEUjAEUjAEUjQEUjAEUjQEUjAEVjAEUjQEU"
+ "jAEVjAEVjAEVjAEVjAEVjAEVjAEVjQEVjAEVjAEWjAEWjAEXiwEXiwEYigEaiQEbiAEdhgEhgwEz"
+ "ci53KX4ihwEZ6GEA");
+ ok(match, "Figure does not match.\n");
+
ID2D1SolidColorBrush_Release(brush);
ID2D1Factory_Release(factory);
release_test_context(&ctx);
--
2.34.1