Wine-devel
Threads by month
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2021
- 74 participants
- 438 discussions
[PATCH 09/12] d2d1/tests: Pass a d2d1_test_context structure to compare_figure().
by Henri Verbeet 15 Jan '21
by Henri Verbeet 15 Jan '21
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d2d1/tests/d2d1.c | 296 ++++++++++++++++++++---------------------
1 file changed, 148 insertions(+), 148 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 01abc314504..38fe6c4ff7d 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -631,14 +631,14 @@ static void read_figure(struct figure *figure, BYTE *data, unsigned int pitch,
figure_add_span(figure, span);
}
-static BOOL compare_figure(IDXGISurface *surface, unsigned int x, unsigned int y,
+static BOOL compare_figure(struct d2d1_test_context *ctx, unsigned int x, unsigned int y,
unsigned int w, unsigned int h, DWORD prev, unsigned int max_diff, const char *ref)
{
struct figure ref_figure, figure;
unsigned int i, j, span, diff;
struct resource_readback rb;
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx->surface, &rb);
figure.span_count = 0;
figure.spans_size = 64;
@@ -3437,7 +3437,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X"
"FBddFxYWXRYYFlsXGBdaFhoWWRYcFlgVHhVXFSAVVhQiFFUUIxRVEyYTVBIoElQRKhFUECwQUxAu"
@@ -3447,7 +3447,7 @@ static void test_path_geometry(void)
"EBVnFBAUaRQOFGsTDhJvEgwSchAMEHYPCg96DQoMggEICgiLAQQIBJQBCJgBCJkBBpoBBpoBBpoB"
"BpsBBJwBBJwBBJwBBJwBBJ0BAp4BAp4BAp4BAp4BAp4BAp4BAp4BAgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 226, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 226, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X"
"FBddFxYWXRYYFlsXGBdaFhoWWRYcFlgVHhVXFSAVVhQiFFUUIxRVEyYTVBIoElQRKhFUECwQUxAu"
@@ -3457,7 +3457,7 @@ static void test_path_geometry(void)
"EBVnFBAUaRQOFGsTDhJvEgwSchAMEHYPCg96DQoMggEICgiLAQQIBJQBCJgBCJkBBpoBBpoBBpoB"
"BpsBBJwBBJwBBJwBBJwBBJ0BAp4BAp4BAp4BAp4BAp4BAp4BAp4BAgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 64,
"gVQBwAIBWgHlAQFYAecBAVYB6QEBVAHrAQEjDCMB7AECHhQeAu0BAxoYGgPvAQMWHhYD8QEDFCAU"
"A/MBBBAkEAT0AQUOJw0F9QEGCioKBvcBBggsCAb4AQgFLgUI+QEJATIBCfsBCAIwAgj8AQcFLAUH"
"/QEFCCgIBf4BBAwiDAT/AQIQHBAClwISlwIBPgGAAgI8Av8BAzwD/QEEPAT7AQY6BvkBBzoH+AEI"
@@ -3469,7 +3469,7 @@ static void test_path_geometry(void)
"BfUBBBAlDwTzAQQSIhIE8QEDFh4WA/ABAhkaGQLvAQIcFhwC7QECIBAgAusBASgEKAHpAQFWAecB"
"AVgB5QEBWgHAAgHhUgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 160, 160, 320, 160, 0xff652e89, 64,
"/VUB5QEBWAHnAQFWAekBAVQB6wECIQ8hAe0BAh0VHQLuAQIZGhkD7wEDFh4WA/EBBBMhEwPzAQQQ"
"JQ8F9AEFDCgNBfUBBgoqCgb3AQcHLQcG+QEIBC8ECPkBPAEJ+wEIAy8CCP0BBgYrBQf9AQUJJgkF"
"/wEDDSANBP8BAhEaEQKYAhAXAYACAT4BgAICPQL+AQM8BPwBBTsE+wEGOgb6AQc5B/gBCDgJ9gEJ"
@@ -3533,21 +3533,21 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM"
"U05STlJOUk5STlFQUFBQUFBQTlRIXD9mMnYqdjJmP1xIVE5QUFBQUFBQUU5STlJOUk5STlNMVExU"
"TFRMVEtWSlZKV0hYSFlGWkZbRFxDXkJfQGE+YzxlOmc4aTZrM28wcix2KHojggEaiwEQlAEImAEI"
"mQEGmgEGmgEGmgEGmwEEnAEEnAEEnAEEnAEEnQECngECngECngECngECngECngECngEC");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 226, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 226, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM"
"U05STlJOUk5STlFQUFBQUFBQTlRIXD9mMnYqdjJmP1xIVE5QUFBQUFBQUU5STlJOUk5STlNMVExU"
"TFRMVEtWSlZKV0hYSFlGWkZbRFxDXkJfQGE+YzxlOmc4aTZrM28wcix2KHojggEaiwEQlAEImAEI"
"mQEGmgEGmgEGmgEGmwEEnAEEnAEEnAEEnAEEnQECngECngECngECngECngECngECngEC");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 64,
"4VIBwAIBWgHlAQFYAecBAVYB6QEBVAHrAQIhDiIB7QECHRUdAu4BAhkaGQPvAQMWHhYD8QEEEyET"
"A/MBBBAkEAT1AQUMKA0F9QEGCioKBvcBBwctBwb5AQgELwQI+QEJATIBCfsBRP0BQ/0BQv8BQf8B"
"QIECP4ACQIACQf4BQ/wBRPsBRvoBR/gBSPcBSvYBS/QBTPMBTvIBTvIBT/ABUPABUe4BUu4BUu4B"
@@ -3556,7 +3556,7 @@ static void test_path_geometry(void)
"RPsBCQEyAQn6AQgELwQI+AEHBy0GB/cBBgoqCgb2AQUMKA0F9AEEECUPBPMBBBIiEwPxAQMWHhYD"
"8AECGRoZA+4BAh0VHQLsAQIhDiIB6wEBVAHpAQFWAecBAVgB5QEBWgHAAgEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 160, 160, 320, 160, 0xff652e89, 64,
"gVQBXAHjAQFaAeUBAVgB5wEBVgHpAQEpAikB6wECIBAgAu0BAhwWHALvAQIZGhkC8AEDFh4WA/EB"
"BBIiEgTzAQQPJRAE9QEFDCgMBfYBBgoqCgb3AQcGLgYH+QEIAzADCPoBRvsBRPwBRP0BQv8BQIAC"
"QIECPoECQP8BQv0BRPwBRPsBRvkBSPgBSPcBSvUBTPQBTPMBTvIBTvEBUPABUO8BUu4BUu4BUu4B"
@@ -5841,18 +5841,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQUFBQUFBQUFDoYQAA");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "yGBQUFBQUFBQUFDoYQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0,
"xjIUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUxjIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 2,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 2,
"zjECnQETjAEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
@@ -5860,18 +5860,18 @@ static void test_draw_geometry(void)
"igEVigEVigEVigEVjAETnQECzjEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "5mAUjAEUjAEUjAEUjAEUhmIA");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "5mAUjAEUjAEUjAEUjAEUhmIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "vmBkPGQ8ZDxkPGTeYQAA");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "vmBkPGQ8ZDxkPGTeYQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0,
"5i4UjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUhjAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -5880,18 +5880,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 10,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 10,
"hDAYgwEieyh1LnAybBcIF2gWDhZkFhIWYRUWFV4VGhVbFRwVWRUeFVcVIBVVFCQUUxQmFFEUKBRP"
"FSgVTRUqFUwULBRLFC4USRQwFEgUMBRHFDIURhQyFEUUNBREFDQUQxQ2FEIUNhRBFDgUQBQ4FEAU"
"OBQ/FDoUPhQ6FD4UOhQ+FDoUPhQ6FD0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
@@ -5934,18 +5934,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0,
"3C4oaUZVUExYRlxCHCgcPxU4FT0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -5954,18 +5954,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FD0VOBU/YEJcRlhMUFVG7S8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 8,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 8,
"3C4obT5dSFRQTlRKGCgYRhYwFkMVNBVBFTYVPxU5FD4UOhQ9FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -5974,18 +5974,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPRQ6FD4UOhQ/FTYVQRU0FUMWMBZGWEpVTVBTSltA8C8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 0,
"3C4oZU5NWERgP2I9HigePBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6028,18 +6028,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 16,
"hDAYgwEieyh1LnAybBcIF2gWDhZkFhIWYRUWFV4WGRVbFRwVWRUeFVcVIBVVFSMUUxQmFFEVJxRP"
"FSgVTRUqFUwULBRLFC4USRUvFEgUMBRHFDIURhQyFEUUNBREFDQUQxQ2FEIUNhRBFDgUQBQ4FEAU"
"OBQ/FTkUPhQ6FD4UOhQ+FDoUPhQ6FD0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
@@ -6048,18 +6048,18 @@ static void test_draw_geometry(void)
"FRwVWxUaFV4VFhVhFhIWZBYOFmgWChZsMnAudCp6IoMBGIQw");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 16,
"3C4obzpjQF5EWkhXFSAVVRQkFFMUJhRRFCgUTxQqFE0VKhVMFCwUSxQuFEoULhVIFDAUSBQwFUYU"
"MhRGFDIURRQ0FEQUNBRDFTQVQhQ2FEIUNhRCFDYUQRQ4FEAUOBRAFDgUQBQ4FD8UOhQ+FDoUPhQ6"
"FD4UOhQ+FDoUPhQ6FD0VOxQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6068,18 +6068,18 @@ static void test_draw_geometry(void)
"LhRLFCwUTBUrFE0UKhRPFCgUURQmFFMUJBRVSldIWUZdQWI78i8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 8,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 8,
"9i80ZERWUExYRV5AHCocPRY4FjwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6171,18 +6171,18 @@ static void test_draw_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0, "q2MKlgEKq2MA");
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0, "q2MKlgEKq2MA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGNQUFCIYwAA");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "iGNQUFCIYwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0,
"qyIKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKQQpLCkEKSwqWAQqW"
@@ -6190,9 +6190,9 @@ static void test_draw_geometry(void)
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqW"
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQrLIwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "4GLAAuBi");
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0, "4GLAAuBi");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 0,
"qyIKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKSwpBCksKQQqWAQqWAQqW"
@@ -6201,7 +6201,7 @@ static void test_draw_geometry(void)
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQrLIwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0,
"rycCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEKAgqKAQoCCokBCgQKiAEKBAqHAQoGCoYBCgYKhQEKCAqEAQoICoMBCgoKggEKCgqBAQoM"
"CoABCgwKfwoOCn4KDgp9ChAKfAoQCnsKEgp6ChIKeQoUCngKFAp3ChYKdgoWCnUKGAp0ChgKcwoa"
@@ -6210,7 +6210,7 @@ static void test_draw_geometry(void)
"CjYKVQo4ClQKOApTCjoKUgo6ClEKPApQCjwKTwo+Ck4KPgpNCkAKTApACksKQgpKCkIKSQpECkgK"
"RApHCkYKozIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0,
"ozIKRgpHCkQKSApECkkKQgpKCkIKSwpACkwKQApNCj4KTgo+Ck8KPApQCjwKUQo6ClIKOgpTCjgK"
"VAo4ClUKNgpWCjYKVwo0ClgKNApZCjIKWgoyClsKMApcCjAKXQouCl4KLgpfCiwKYAosCmEKKgpi"
"CioKYwooCmQKKAplCiYKZgomCmcKJApoCiQKaQoiCmoKIgprCiAKbAogCm0KHgpuCh4KbwocCnAK"
@@ -6219,7 +6219,7 @@ static void test_draw_geometry(void)
"CgIKiwEUjAEUjQESjgESjwEQkAEQkQEOkgEOkwEMlAEMlQEKlgEKlwEImAEImQEGmgEGmwEEnAEE"
"nQECngECrycA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0,
"rycCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEKAgqKAQoCCokBCgQKiAEKBAqHAQoGCoYBCgYKhQEKCAqEAQoICoMBCgoKggEKCgqBAQoM"
"CoABCgwKfwoOCn4KDgp9ChAKfAoQCnsKEgp6ChIKeQoUCngKFAp3ChYKdgoWCnUKGAp0ChgKcwoa"
@@ -6228,7 +6228,7 @@ static void test_draw_geometry(void)
"CjYKVQo4ClQKOApTCjoKUgo6ClEKPApQCjwKTwo+Ck4KPgpNCkAKTApACksKQgpKCkIKSQpECkgK"
"RApHWkZagzEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 0,
"gzFaRlpHCkQKSApECkkKQgpKCkIKSwpACkwKQApNCj4KTgo+Ck8KPApQCjwKUQo6ClIKOgpTCjgK"
"VAo4ClUKNgpWCjYKVwo0ClgKNApZCjIKWgoyClsKMApcCjAKXQouCl4KLgpfCiwKYAosCmEKKgpi"
"CioKYwooCmQKKAplCiYKZgomCmcKJApoCiQKaQoiCmoKIgprCiAKbAogCm0KHgpuCh4KbwocCnAK"
@@ -6283,7 +6283,7 @@ static void test_draw_geometry(void)
ID2D1RectangleGeometry_Release(rect_geometry[1]);
ID2D1RectangleGeometry_Release(rect_geometry[0]);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6291,7 +6291,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 32,
"8XYGtQIOrAIXpAIfmwIokwIwigI4gwJA+gFJ8gFR6QEzAiXhATMKJdgBMxMl0AEzGyXHATMkJb8B"
"MysmtgEzNCWvATM8JaYBM0UlngEzTSWVATNWJY0BM14lhAEzZyV8M28lczN4JWszgAElYjOIASZa"
"M5ABJVgtmQElWCWhASVYJaEBJVgloQElWCWhASVYJaEBJVgloQElWCWhASVYJaEBJVglmQEtWCWQ"
@@ -6299,7 +6299,7 @@ static void test_draw_geometry(void)
"KzO/ASUkM8cBJRsz0AElEzPYASUKM+EBJQIz6QFR8gFJ+gFAgwI4igIwkwIomwIfpAIXrAIOtQIG"
"8XYA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 32,
"ujEBngECnQEDnQEEmwEFmgEHmQEHmAEIlwEKlgEKlQELlAENkwENkgEOkQEQjwERjwESjQETjAEU"
"jAEKAQqKAQoCCokBCgMKiQEKBAqHAQoFCoYBCgYKhgEKBwqEAQoICoMBCgkKgwEKCgqBAQoLCoAB"
"Cg0KfgsNCn4KDgp9ChAKewsQCnsKEQp6ChMKeAoUCngKFAp3ChYKdQoXCnUKGApzChkKcgoaCnIK"
@@ -6318,7 +6318,7 @@ static void test_draw_geometry(void)
"CoMBCggKhAEKBwqGAQoGCoYBCgUKhwEKBAqJAQoDCokBCgIKigEKAQqMARSMARONARKPARGPARCR"
"AQ6SAQ2TAQ2UAQuVAQqWAQqXAQiYAQeZAQeaAQWbAQSdAQOdAQKeAQG6MQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 64,
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 64,
"82ICvQIEugIHuAIJtgIKtAINsgIPsAIRrQITrAIVqQIYpwIZpgIbowIeoQIgnwIhnQIkmwImmAIp"
"lgIVARSVAhUDFJICFQUVkAIVBxSPAhUJFIwCFQwUigIVDRWHAhYPFIYCFRIUhAIVFBSBAhUWFf8B"
"FRgU/gEVGhT7ARUcFfkBFR4U9wEWIBT1ARUjFPMBFSQV8AEVJxTvARUpFOwBFisU6gEVLRXoARUv"
@@ -6454,7 +6454,7 @@ static void test_draw_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6462,7 +6462,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6470,7 +6470,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6478,7 +6478,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0,
"yC5aRlpGWjxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6487,7 +6487,7 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 64,
"3SoDYAM6B1gHOgtQCzoPSA87EkASPBc2FzwcLBw8IiAiPWI+Yj5iPhQBOAEUPhQKJgoUPxQ4FEAU"
"OBRAFDgUQBQ4FEAUOBRBFDYUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRDFDQURBQ0FEQUNBREFDQURBQ0"
"FEQUNBREFDQURBQ0FEQUNBREFDQURRQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIU"
@@ -6496,7 +6496,7 @@ static void test_draw_geometry(void)
"NhRCFDYUQhQ2FEEUOBRAFDgUQBQ4FEAUOBRAFDgUPxQKJgoUPhQBOAEUPmI+Yj5iPSIgIjwcLBw8"
"FzYXPBJAEjsPSA86C1ALOgdYBzoDYAPdKgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 1024,
"uxUBnwECngEDnQEEnAEFmwEGmwEGmgEHmQEImAEJlwEKlgELlQEMlQEMlAENkwEOkgEPkQEQkAER"
"VQQ2Ek0KOBJFEDkTPRY6FDUcOxUrJDwYHi09Yj5iP2BAQwkUQDgUFEAUOBRAFDcUQRQ3FEEUNxRC"
"FDYUQhQ2FEIUNhRCFDUUQxQ1FEMUNRRDFDUUQxQ1FEQUNBREFDQURBQ0FEQUNBREFDQURBQ0FEQU"
@@ -6507,7 +6507,7 @@ static void test_draw_geometry(void)
"NgRVEZABEJEBD5IBDpMBDZQBDJUBDJUBC5YBCpcBCZgBCJkBB5oBBpsBBpsBBZwBBJ0BA54BAp8B"
"AbsV");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 1024,
"pBYBngECnQEDnAEEmwEFmgEGmQEGmQEHmAEIlwEJlgEKlQELlAEMkwEMkwENkgEOkQEPkAEQNgRV"
"ETcKTRI4EEUSOhY9EzscNRQ8JCsVPS0eGD5iPmI/YEAUCUNAFBQ4QBQ4FEEUNxRBFDcUQRQ3FEEU"
"NhRCFDYUQhQ2FEMUNRRDFDUUQxQ1FEMUNRRDFDUUQxQ0FEQUNBREFDQURBQ0FEQUNBREFDQURBQ0"
@@ -6518,7 +6518,7 @@ static void test_draw_geometry(void)
"EVUENhCQAQ+RAQ6SAQ2TAQyTAQyUAQuVAQqWAQmXAQiYAQeZAQaZAQaaAQWbAQScAQOdAQKeAQGk"
"FgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 64,
"wCsDmQEHlQELkQEPSwJAEkgLNhc8HCwcPCIgIj1iPmI+Yj4UATgBFD4UCiYKFD8UOBRAFDgUQBQ4"
"FEAUOBRAFDgUQRQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDYUQxQ0FEQUNBREFDQURBQ0FEQUNBREFDQU"
"RBQ0FEQUNBREFDQURBQ0FEUUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRG"
@@ -6528,7 +6528,7 @@ static void test_draw_geometry(void)
"QBI7D0gPOgtQCzoHWAc6A2AD3SoA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 64,
"3SkmcThiRFdOTVhEICAgPhwsHDwXNhc8FDwUOxQ+FDoUPhQ6FD4UOhQ+FDoUPhQ5FEAUOBRAFDgU"
"QBQ4FEAUOBRAFDcUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDUURBQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQzFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYU"
@@ -6537,7 +6537,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNxRAFDgUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDoUPhQ6FD4UOhQ+FDsUPBQ8FzYXPBws"
"HD4gICBEWE1OV0RiOHEm3SkA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 1024,
"zykoczhkRVhQTlpEFx4tPRUrJDwUNRw7FDwVOxQ+FDoUPhQ5FEAUOBRAFDgUQBQ4FEAUOBRBFDcU"
"QRQ3FEEUNhRCFDYUQhQ2FEIUNhRDFDUUQxQ1FEMUNRRDFDUUQxQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQ0FEQUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUU"
@@ -6546,7 +6546,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNhRCFDYUQRQ3FEEUNxRBFDgUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDsVPBQ7HDUUPCQr"
"FT0tHhdEWk5QWEVkOHMozykA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 1024,
"6SkobThfRVNQSFpALR4XPSQrFTscNRQ7FTwUOhQ+FDoUPhQ5FEAUOBRAFDgUQBQ4FEAUNxRBFDcU"
"QRQ3FEEUNxRCFDYUQhQ2FEIUNRRDFDUUQxQ1FEMUNRRDFDUUQxQ1FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQ0FEQUNBRFFDMURRQzFEUUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUU"
@@ -6555,7 +6555,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNhRCFDcUQRQ3FEEUNxRBFDcUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDoUPBU7FDUcOxUr"
"JD0XHi1AWkhQU0VfOG0o6SkA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 64,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 64,
"3SkmcThiRFdOTVhGHiAgRhQsHDwXNhc8FDwUOxQ+FDoUPhQ6FD4UOhQ+FDoUPhQ5FEAUOBRAFDgU"
"QBQ4FEAUOBRAFDcUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDUURBQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQzFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYU"
@@ -6634,7 +6634,7 @@ static void test_draw_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 128,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 128,
"yjIJkQEHBwaIAQUSBYMBBBYEggEEFgSCAQQWBIIBBBYEggEEFgSCAQQWBIIBBBYEggEEFgSCAQQW"
"BIIBBBYEggEEFgSDAQQVBIMBBBUEgwEEFQSDAQQVBIMBBBUEgwEEFQSDAQQVBIMBBBUEgwEEFQSD"
"AQQVBIQBBBQEhAEEFASEAQQTBIUBBBMEhQEEEwSFAQQTBIUBBBMEhQEEEwSGAQQSBIYBBBIEhgEE"
@@ -6643,13 +6643,13 @@ static void test_draw_geometry(void)
"AQaaAQaaAQaaAQabAQWbAQWbAQWbAQWaAQeZAQeZAQeZAQiXAQQBBJYBBAMElQEEAwWRAQUGBY0B"
"BQwFhwEFEgSCAQUXBYABBBoFfgUYBIIBBhEFiAEUpTEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 512,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 512,
"yJIBArkCDa4CGKMCIZoCK5ECM4gCO4ECQ/gBS/EBUesBLAYl5QEsDiPeASwWIdkBLBwh0wEsISHO"
"ASsgKMsBKR4vyAEnHDPIASUaNMsBIxg1mQEFMCIUN54BCygiDzijAREhIgY9qAEYGWGuAR4RXbMB"
"JAhbuQGAAcABesYBc84Ba9YBTvQBP4MCOIoCNI4CM5ACMZICL5QCLZYCK5kCKJsCJ54CI6MCHq8C"
"EraSAQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 512,
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 512,
"xWkCmwEFmAEJlQELlAENkgEOkQEPjwESjQETjAEVigELAQqJAQsCCogBCwQKhwEKBQqGAQoGCoYB"
"CgcKhAEKCAqEAQoIC4IBCgoKggEKCgqBAQoMCoABCgwKfwoNCn8KDgp9Cg8KfQoPCnwKEQp7ChEK"
"egoSCnoKEwp4ChQKeAoUCncLFQp2ChYKdgoWCnYKFwp2ChYKdgoWCncKFgp2ChYKdgoWCncKFQt2"
@@ -6663,7 +6663,7 @@ static void test_draw_geometry(void)
"iQEKAgqJAQoCCooBCgIKiQEKAgqKAQoBCosBCgEKigEKAQqLARSMARSLARSMAROMARONARKOARGO"
"ARGPARCQAQ6RAQ2YAQTEZAAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 1024,
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 1024,
"ytABA7gCCbICD60CFKkCF6cCGqMCHqACIZ0CJJoCJpgCKZUCFgIUkgIWBBWPAhYHFI4CFQoUjAIV"
"DBSKAhUNFYgCFQ8UhwIVERSFAhUTFIMCFRQVgQIUFxSAAhQZFP4BFBoV/AEUHBT7ARQeFPkBFB8V"
"9wEUIRT2ARQjFPQBFSMV8gEVJRTxARUnFPABFCgV7gEUKhTtARQsFOwBFCwV7AEULBTsARUsFOwB"
@@ -6740,25 +6740,25 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 8,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 8,
"yjIMjwEWhwEcggEgfiR6KHYscy5xMG40azZpOGc6ZTxjPmI+YUBfQl1EXERbRlpGWUhYSFdKVkpV"
"TFRMVExTTlJOUk5STlJOUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5STlJOUk5STlNMVExUTFVK"
"VkpXSFhIWUZaRltEXERdQl9AYT5iPmM8ZTpnOGk2azRuMHEucyx2KHokfiCCARyHARaPAQzKMgAA");
@@ -6798,37 +6798,37 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0,
"szI6YURZSlROUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5USllEYTqzMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 2,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 2,
"tjI0aDxhQlxGWEpVTFNOUk5RUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFFOUk5TTFVKWEZcQmA+ZzS2MgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 0,
"sDJAWkxSUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFJMWkCwMgAA");
@@ -6868,37 +6868,37 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 10,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 10,
"yjIMjwEWhwEcggEgfiR6KHYscy5xMG40azZpOGc6ZTxjPmI+YUBfQl1EXERbRlpGWUhYSFdKVkpV"
"TFRMVExTTlJOUk5STlJOUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5STlJOUk5STlNMVExUTFVK"
"VkpXSFhIWUZaRltEXERdQl9AYT5iPmM8ZTpnOGk2azRuMHEucyx2KHokfiCCARyHARaPAQzKMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 10,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 10,
"uTIucDJsNmk4ZzplPGM+YUBgQF9CXkJdRFxEW0ZaRllIWEhXSlZKVkpWSlVMVExUTFRMU05STlJO"
"Uk5STlJOUk9QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFFPUU5STlJOUk5STlJOU0xU"
"TFRMVExVSlZKVkpWSldIWEhZRlpGW0RcRF1CXkJfQGBAYT5jPGU6ZzhpNmwycC65MgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 10,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 10,
"vzIiczhhRldMUlBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUkxXRmA6cSS+MgAA");
@@ -6987,43 +6987,43 @@ static void test_fill_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 0,
"7zMCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEWigEWiQEYiAEYhwEahgEahQEchAEcgwEeggEegQEggAEgfyJ+In0kfCR7JnomeSh4KHcq"
"dip1LHQscy5yLnEwcDBvMm4ybTRsNGs2ajZpOGg4ZzpmOmU8ZDxjPmI+YUBgQF9CXkJdRFxEW0Za"
"RllIWEhXSlZKVUxUTFNOUk5RUKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 0,
"qDJQUU5STlNMVExVSlZKV0hYSFlGWkZbRFxEXUJeQl9AYEBhPmI+YzxkPGU6ZjpnOGg4aTZqNms0"
"bDRtMm4ybzBwMHEuci5zLHQsdSp2KncoeCh5JnomeyR8JH0ifiJ/IIABIIEBHoIBHoMBHIQBHIUB"
"GoYBGocBGIgBGIkBFooBFosBFIwBFI0BEo4BEo8BEJABEJEBDpIBDpMBDJQBDJUBCpYBCpcBCJgB"
"CJkBBpoBBpsBBJwBBJ0BAp4BAu8z");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 0,
"7zMCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEWigEWiQEYiAEYhwEahgEahQEchAEcgwEeggEegQEggAEgfyJ+In0kfCR7JnomeSh4KHcq"
"dip1LHQscy5yLnEwcDBvMm4ybTRsNGs2ajZpOGg4ZzpmOmU8ZDxjPmI+YUBgQF9CXkJdRFxEW0Za"
"RllIWEhXSlZKVUxUTFNOUk5RUKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 0,
"qDJQUU5STlNMVExVSlZKV0hYSFlGWkZbRFxEXUJeQl9AYEBhPmI+YzxkPGU6ZjpnOGg4aTZqNms0"
"bDRtMm4ybzBwMHEuci5zLHQsdSp2KncoeCh5JnomeyR8JH0ifiJ/IIABIIEBHoIBHoMBHIQBHIUB"
"GoYBGocBGIgBGIkBFooBFosBFIwBFI0BEo4BEo8BEJABEJEBDpIBDpMBDJQBDJUBCpYBCpcBCJgB"
@@ -7075,18 +7075,18 @@ static void test_fill_geometry(void)
ID2D1RectangleGeometry_Release(rect_geometry[1]);
ID2D1RectangleGeometry_Release(rect_geometry[0]);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 32,
"sIMBA7cCDK8CFKYCHZ4CJJYCLY4CNYUCPv0BRvQBT+wBV+MBYNsBaNIBccoBecEBgQG6AYkBsQGS"
"AakBmgGgAaMBmAGrAY8BtAGHAbwBfsUBfcYBfcYBfcUBfsUBfcYBfcYBfcYBfcYBfcUBfr0BhgG0"
"AY8BrAGXAaMBoAGbAagBkgGwAYsBuAGCAcEBeskBcdIBadoBYOMBWOsBT/QBR/wBPoUCNowCLpUC"
"Jp0CHaYCFa4CDLcCBK+DAQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 32,
"+D0BngEDnQEDnAEEmwEGmgEGmQEHmAEJlwEJlgELlAEMkwENkwEOkQEPkAEQkAERjgESjQETjQEU"
"iwEVigEXiQEXiAEYhwEahgEahQEbhAEdggEeggEegQEgfyF/In0jfCR8JXomeSd5KHcpdip2K3Qs"
"cy5xL3EvcDFuMm4ybTRrNWs1ajdoOGg5ZjplO2U8Yz1iPmFAYEBfQV5DXUNcRVpGWkZZSFdJV0lW"
@@ -7097,7 +7097,7 @@ static void test_fill_geometry(void)
"KXgneSZ6JXwkfCN9In8hfyCBAR6CAR6CAR2EARuFARuFARqHARiIAReJAReKARWLARSNARONARKO"
"ARGQARCQAQ+RAQ6TAQ2TAQyUAQuWAQqWAQmYAQeZAQaaAQabAQScAQOdAQOeAQH4PQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 32,
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 32,
"sXkBvgIDvAIEugIHuAIJtgILswINsgIPrwISrQITrAIVqQIYpwIapQIbowIeoQIgngIjnAIkmwIm"
"mAIplgIqlQIskgIvkAIxjQIzjAI1igI3hwI5hgI7hAI9gQJA/wFB/QFE+wFG+QFI9gFK9QFM8wFO"
"8AFQ7wFS7AFV6gFX6AFY5gFb5AFd4gFf3wFh3gFj2wFm2QFn2AFp1QFs0wFu0QFvzwFyzQF0ygF3"
@@ -7225,70 +7225,70 @@ static void test_fill_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 160, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
- match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 320, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(&ctx, 480, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 0, 160, 160, 160, 0xff652e89, 16,
"qDICTAJQB0IHUQs4C1IRLBFSGxgbUk5STlNMVExUTFRMVExVSlZKVkpWSlZKVkpXSFhIWEhYSFhI"
"WEhYSFhIWEhYSFlGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZa"
"RllIWEhYSFhIWEhYSFhIWEhYSFhIV0pWSlZKVkpWSlZKVUxUTFRMVExUTFNOUk5SGxgbUhEsEVIL"
"OAtRB0IHUAJMAqgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 160, 160, 160, 160, 0xff652e89, 16,
"qDIBSwRQAkMKUQQ5EVIIKxtTDRkmVExUTFRMVEtVS1VLVkpWSlZKVklXSVdJV0lXSVhIWEhYSFhI"
"WEhYSFhIWEhYSFhIWUdZR1lHWUdZR1lHWUdZR1lHWUdZSFhIWUdZR1lHWUdZR1lHWUdZR1lHWUdZ"
"SFhIWEhYSFhIWEhYSFhIWEhYSFhJV0lXSVdJV0lWSlZKVkpWS1VLVUtUTFRMVExUJhkNUxsrCFIR"
"OQRRCkMCUARLAagy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 320, 160, 160, 160, 0xff652e89, 16,
"qDIESwFRCkMCUhE5BFIbKwhTJhkNVExUTFRMVUtVS1VLVUpWSlZKV0lXSVdJV0lXSVdIWEhYSFhI"
"WEhYSFhIWEhYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdY"
"SFhIWEhYSFhIWEhYSFhIWEhYSFdJV0lXSVdJV0lXSlZKVkpVS1VLVUtVTFRMVExUDRkmUwgrG1IE"
"ORFSAkMKUQFLBKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 480, 160, 160, 160, 0xff652e89, 16,
"qDICTAJQB0IHUQs4C1IRLBFSGxgbUk5STlNMVExUTFRMVExVSlZKVkpWSlZKVkpXSFhIWEhYSFhI"
"WEhYSFhIWEhYSFlGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZa"
"RllIWEhYSFhIWEhYSFhIWEhYSFhIV0pWSlZKVkpWSlZKVUxUTFRMVExUTFNOUk5SGxgbUhEsEVIL"
"OAtRB0IHUAJMAqgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 0, 320, 160, 160, 0xff652e89, 16,
"pCwYfixuOGNCWUxSUFBQT1JOUk5STlJOUk1UTFRMVExUTFRLVkpWSlZKVkpWSlZJWEhYSFhIWEhY"
"SFhIWEhYSFhIWEdaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpG"
"WkdYSFhIWEhYSFhIWEhYSFhIWEhYSVZKVkpWSlZKVkpWS1RMVExUTFRMVE1STlJOUk5STlJPUFBQ"
"UkxZQmM4bix+GKQs");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 160, 320, 160, 160, 0xff652e89, 16,
"liwZgQErcTllQ1xLVFBQUU9STlJNVExUTFRMVExVS1VLVUpWSlZKVkpXSVdJV0lXSVdIWEhYSFhI"
"WEhYSFhIWEhYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdZR1hIWEdZR1lHWUdZR1lHWUdZR1lHWUdZ"
"R1hIWEhYSFhIWEhYSFhIWEhYSFhIV0lXSVdJV0lXSlZKVkpWSlVLVUtVTFRMVExUTFRNUk5ST1FQ"
"UFRLXENlOXErgQEZliwA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 320, 320, 160, 160, 0xff652e89, 16,
"sSwZeytrOV9DVktRUE9RTlJOUk1UTFRMVExUS1VLVUtVS1ZKVkpWSVdJV0lXSVdJV0lYSFhIWEhY"
"SFhIWEhYSFhIWEhYSFlHWUdZR1lHWUdZR1lHWUdZR1lIWEhYSFlHWUdZR1lHWUdZR1lHWUdZR1lI"
"WEhYSFhIWEhYSFhIWEhYSFhIWElXSVdJV0lXSVdJVkpWSlZLVUtVS1VLVExUTFRMVE1STlJOUU9Q"
"UUtWQ185ayt7GbEs");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(&ctx, 480, 320, 160, 160, 0xff652e89, 16,
"pCwYfixuOGNCWUxSUFBQT1JOUk5STlJOUk1UTFRMVExUTFRLVkpWSlZKVkpWSlZJWEhYSFhIWEhY"
"SFhIWEhYSFhIWEdaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpG"
"WkdYSFhIWEhYSFhIWEhYSFhIWEhYSVZKVkpWSlZKVkpWS1RMVExUTFRMVE1STlJOUk5STlJPUFBQ"
@@ -7364,19 +7364,19 @@ static void test_fill_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 32,
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 32,
"6DMNjgEWiAEahgEahgEahgEahgEahgEahgEahgEahgEahgEahgEahwEZhwEZhwEZhwEZhwEZhwEZ"
"hwEZhwEZhwEZiAEYiAEYiAEYiAEYiAEXiQEXiQEXiQEXigEWigEWigEWigEWigEWigEWigEWiwEU"
"jAEUjAEUjAEUjQESjgESjwEQkAEQkQEOkgENlAEMlQEKlgEKlwEImAEImQEHmQEGmwEFmwEEnQED"
"nQECngECngECnwEBnwEBnwEBnwEBnwEBnwECnQEDnQEDnQEEmwEFmgEHmQEHlwELkQERjAEXhgEd"
"hAEfgwEchgEXjwEMqTEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 32,
"h58BBrYCDq0CF6QCIJwCKJMCMIwCNoUCPf8BQ/kBSPQBTu4BTe8BTPEBSfUBRvgBQf0BPYECOYUC"
"NIoCMI4CK+UBAS0W/AEHIwiPAgsaBZcCEAwIngIepAIaqAIWrAITsAIRsgIPtQIMtwILugIHwAIB"
"ypwB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 32,
"wW4DnAEEmwEFmgEHmAEIlwEKlQELlAEMkwEOkQEPkAEQkAERjgESjgETjAEUjAEUiwEWigEWiQEX"
"iQEYhwEZhwEZhgEbhQEbhAEchAEdggEeggEeggEfgAEggAEggAEhgAEggAEggQEggAEggAEggQEg"
"gAEggQEfgQEfggEfgQEfgQEfggEfgQEfggEeggEfggEeggEegwEdgwEeggEegwEdgwEegwEdgwEd"
@@ -7387,7 +7387,7 @@ static void test_fill_geometry(void)
"AQ6SAQ2TAQ2SAQ2TAQ2TAQyTAQyUAQyUAQuUAQuVAQuUAQuVAQqWAQmWAQqWAQmXAQiXAQiYAQeY"
"AQeZAQWbAQSDZwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 32,
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 32,
"g90BBLkCCLYCC7ICDrACEa0CFKoCF6cCGqQCHKMCHqECIJ8CIpwCJJsCJpkCKJcCKZYCK5QCLZIC"
"L5ACMI8CMo0CNIsCNYoCN4gCOYcCOYYCO4QCPYICPoECQIACQYACQIECQIACQIECQIECQIECP4IC"
"P4ICP4ECP4ICP4ICPoMCPoMCPoMCPYQCPYMCPYQCPYQCPYQCPIUCPIUCPIUCO4YCO4YCOoYCO4YC"
@@ -7468,13 +7468,13 @@ static void test_fill_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(&ctx, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 0, "gJAD");
+ match = compare_figure(&ctx, 160, 0, 320, 160, 0xff652e89, 0, "gJAD");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 0, "gJAD");
+ match = compare_figure(&ctx, 0, 160, 160, 320, 0xff652e89, 0, "gJAD");
ok(match, "Figure does not match.\n");
- match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 0, "gKAG");
+ match = compare_figure(&ctx, 160, 160, 320, 320, 0xff652e89, 0, "gKAG");
ok(match, "Figure does not match.\n");
ID2D1SolidColorBrush_Release(brush);
@@ -7713,7 +7713,7 @@ static void test_bezier_intersect(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 160, 120, 320, 240, 0xff652e89, 2048,
+ match = compare_figure(&ctx, 160, 120, 320, 240, 0xff652e89, 2048,
"aRQjIxRpYiIcHCJiXSwXFyxdWTQTEzRZVTsQEDtVUkIMDEJST0cKCkdPTUsICEtNSlEFBVFKSFUD"
"A1VIRlkBAVlGRFsBAVtEQlwCAlxCQFwEBFxAPl0FBV0+PF0HB108Ol4ICF46OV0KCl05N14LC143"
"Nl4MDF42NF8NDV80M14PD14zMV8QEF8xMF8REV8wL18SEl8vLWATE2AtLGAUFGAsK2EUFGErKWIV"
@@ -7763,7 +7763,7 @@ static void test_bezier_intersect(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(ctx.surface, 160, 120, 320, 240, 0xff652e89, 2048,
+ match = compare_figure(&ctx, 160, 120, 320, 240, 0xff652e89, 2048,
"pQIZkgIrhAI5/QE/9gFH7wFO6wFS5wFW4gFb3gFf2wFi2AFl1gFn1AFp0gFszwFuzQFxywFyyQF1"
"xwF2xgF4xAF5xAF6wgF8wAF+vwF+vwF/vQGBAbwBggG7AYMBugGEAbkBhQG4AYYBtwGHAbcBiAG1"
"AYkBtAGKAbQBigGzAYsBswGMAbEBjQGxAY0BsQGOAa8BjwGvAZABrgGQAa4BkQGtAZEBrQGSAawB"
--
2.20.1
2
1
[PATCH 08/12] d2d1/tests: Pass a d2d1_test_context structure to compare_surface().
by Henri Verbeet 15 Jan '21
by Henri Verbeet 15 Jan '21
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d2d1/tests/d2d1.c | 52 +++++++++++++++++++++---------------------
1 file changed, 26 insertions(+), 26 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index a1869dcaaaa..01abc314504 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -461,12 +461,12 @@ static BOOL compare_sha1(void *data, unsigned int pitch, unsigned int bpp,
return !strcmp(ref_sha1, (char *)sha1);
}
-static BOOL compare_surface(IDXGISurface *surface, const char *ref_sha1)
+static BOOL compare_surface(struct d2d1_test_context *ctx, const char *ref_sha1)
{
struct resource_readback rb;
BOOL ret;
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx->surface, &rb);
ret = compare_sha1(rb.data, rb.pitch, 4, rb.width, rb.height, ref_sha1);
release_resource_readback(&rb);
@@ -1260,7 +1260,7 @@ static void test_clip(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9");
+ match = compare_surface(&ctx, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9");
ok(match, "Surface does not match.\n");
/* Fractional clip rectangle coordinates, aliased mode. */
@@ -1326,7 +1326,7 @@ static void test_clip(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
+ match = compare_surface(&ctx, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
ok(match, "Surface does not match.\n");
release_test_context(&ctx);
@@ -1670,7 +1670,7 @@ static void test_color_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb");
+ match = compare_surface(&ctx, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb");
ok(match, "Surface does not match.\n");
ID2D1SolidColorBrush_Release(brush);
@@ -1809,7 +1809,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
+ match = compare_surface(&ctx, "95675fbc4a16404c9568d41b14e8f6be64240998");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1821,7 +1821,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
+ match = compare_surface(&ctx, "95675fbc4a16404c9568d41b14e8f6be64240998");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_SetTransform(rt, &tmp_matrix);
@@ -1910,7 +1910,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
+ match = compare_surface(&ctx, "f5d039c280fa33ba05496c9883192a34108efbbe");
ok(match, "Surface does not match.\n");
/* Invalid interpolation mode. */
@@ -1928,7 +1928,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
+ match = compare_surface(&ctx, "f5d039c280fa33ba05496c9883192a34108efbbe");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1940,7 +1940,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "59043096393570ad800dbcbfdd644394b79493bd");
+ match = compare_surface(&ctx, "59043096393570ad800dbcbfdd644394b79493bd");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1969,7 +1969,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "b4b775afecdae2d26642001f4faff73663bb8b31");
+ match = compare_surface(&ctx, "b4b775afecdae2d26642001f4faff73663bb8b31");
ok(match, "Surface does not match.\n");
ID2D1Bitmap_Release(bitmap);
@@ -2018,7 +2018,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
+ match = compare_surface(&ctx, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
ok(match, "Surface does not match.\n");
if (SUCCEEDED(ID2D1BitmapBrush_QueryInterface(brush, &IID_ID2D1BitmapBrush1, (void **)&brush1)))
@@ -3296,7 +3296,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "3aace1b22aae111cb577614fed16e4eb1650dba5");
+ match = compare_surface(&ctx, "3aace1b22aae111cb577614fed16e4eb1650dba5");
ok(match, "Surface does not match.\n");
/* Edge test. */
@@ -3377,7 +3377,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "bfb40a1f007694fa07dbd3b854f3f5d9c3e1d76b");
+ match = compare_surface(&ctx, "bfb40a1f007694fa07dbd3b854f3f5d9c3e1d76b");
ok(match, "Surface does not match.\n");
ID2D1TransformedGeometry_Release(transformed_geometry);
ID2D1PathGeometry_Release(geometry);
@@ -3600,7 +3600,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "a875e68e0cb9c055927b1b50b879f90b24e38470");
+ match = compare_surface(&ctx, "a875e68e0cb9c055927b1b50b879f90b24e38470");
ok(match, "Surface does not match.\n");
ID2D1PathGeometry_Release(geometry);
@@ -4076,7 +4076,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "48c41aff3a130a17ee210866b2ab7d36763934d5");
+ match = compare_surface(&ctx, "48c41aff3a130a17ee210866b2ab7d36763934d5");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4084,7 +4084,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "6487e683730fb5a77c1911388d00b04664c5c4e4");
+ match = compare_surface(&ctx, "6487e683730fb5a77c1911388d00b04664c5c4e4");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4092,7 +4092,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "7a35ba09e43cbaf591388ff1ef8de56157630c98");
+ match = compare_surface(&ctx, "7a35ba09e43cbaf591388ff1ef8de56157630c98");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4133,7 +4133,7 @@ static void test_alpha_mode(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
+ match = compare_surface(&ctx, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
ok(match, "Surface does not match.\n");
rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -4170,7 +4170,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "b44510bf2d2e61a8d7c0ad862de49a471f1fd13f");
+ match = compare_surface(&ctx, "b44510bf2d2e61a8d7c0ad862de49a471f1fd13f");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4178,7 +4178,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "2184f4a9198fc1de09ac85301b7a03eebadd9b81");
+ match = compare_surface(&ctx, "2184f4a9198fc1de09ac85301b7a03eebadd9b81");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4186,7 +4186,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "6527ec83b4039c895b50f9b3e144fe0cf90d1889");
+ match = compare_surface(&ctx, "6527ec83b4039c895b50f9b3e144fe0cf90d1889");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4227,7 +4227,7 @@ static void test_alpha_mode(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "465f5a3190d7bde408b3206b4be939fb22f8a3d6");
+ match = compare_surface(&ctx, "465f5a3190d7bde408b3206b4be939fb22f8a3d6");
ok(match, "Surface does not match.\n");
refcount = ID2D1Bitmap_Release(bitmap);
@@ -4566,7 +4566,7 @@ static void test_bitmap_updates(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "cb8136c91fbbdc76bb83b8c09edc1907b0a5d0a6");
+ match = compare_surface(&ctx, "cb8136c91fbbdc76bb83b8c09edc1907b0a5d0a6");
ok(match, "Surface does not match.\n");
ID2D1Bitmap_Release(bitmap);
@@ -4687,7 +4687,7 @@ static void test_opacity_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(hr == D2DERR_INCOMPATIBLE_BRUSH_TYPES, "Got unexpected hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "7141c6c7b3decb91196428efb1856bcbf9872935");
+ match = compare_surface(&ctx, "7141c6c7b3decb91196428efb1856bcbf9872935");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4729,7 +4729,7 @@ static void test_opacity_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(ctx.surface, "c3a5802d1750efa3e9122c1a92f6064df3872732");
+ match = compare_surface(&ctx, "c3a5802d1750efa3e9122c1a92f6064df3872732");
ok(match, "Surface does not match.\n");
ID2D1BitmapBrush_Release(bitmap_brush);
--
2.20.1
2
1
[PATCH 07/12] d2d1/tests: Store the resource data pointer and row-pitch directly in struct resource_readback.
by Henri Verbeet 15 Jan '21
by Henri Verbeet 15 Jan '21
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
dlls/d2d1/tests/d2d1.c | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index c8c0e83df1c..a1869dcaaaa 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -54,8 +54,8 @@ struct d2d1_test_context
struct resource_readback
{
ID3D10Resource *resource;
- D3D10_MAPPED_TEXTURE2D map_desc;
- unsigned int width, height;
+ unsigned int pitch, width, height;
+ void *data;
};
struct figure
@@ -314,6 +314,7 @@ static void cubic_to(ID2D1GeometrySink *sink, float x1, float y1, float x2, floa
static void get_surface_readback(IDXGISurface *surface, struct resource_readback *rb)
{
D3D10_TEXTURE2D_DESC texture_desc;
+ D3D10_MAPPED_TEXTURE2D map_desc;
DXGI_SURFACE_DESC surface_desc;
ID3D10Resource *src_resource;
ID3D10Device *device;
@@ -346,8 +347,11 @@ static void get_surface_readback(IDXGISurface *surface, struct resource_readback
ID3D10Resource_Release(src_resource);
ID3D10Device_Release(device);
- hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->resource, 0, D3D10_MAP_READ, 0, &rb->map_desc);
+ hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->resource, 0, D3D10_MAP_READ, 0, &map_desc);
ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr);
+
+ rb->pitch = map_desc.RowPitch;
+ rb->data = map_desc.pData;
}
static void release_resource_readback(struct resource_readback *rb)
@@ -358,7 +362,7 @@ static void release_resource_readback(struct resource_readback *rb)
static DWORD get_readback_colour(struct resource_readback *rb, unsigned int x, unsigned int y)
{
- return ((DWORD *)((BYTE *)rb->map_desc.pData + y * rb->map_desc.RowPitch))[x];
+ return ((DWORD *)((BYTE *)rb->data + y * rb->pitch))[x];
}
static BOOL compare_uint(unsigned int x, unsigned int y, unsigned int max_diff)
@@ -463,8 +467,7 @@ static BOOL compare_surface(IDXGISurface *surface, const char *ref_sha1)
BOOL ret;
get_surface_readback(surface, &rb);
- ret = compare_sha1(rb.map_desc.pData, rb.map_desc.RowPitch, 4,
- rb.width, rb.height, ref_sha1);
+ ret = compare_sha1(rb.data, rb.pitch, 4, rb.width, rb.height, ref_sha1);
release_resource_readback(&rb);
return ret;
@@ -641,7 +644,7 @@ static BOOL compare_figure(IDXGISurface *surface, unsigned int x, unsigned int y
figure.spans_size = 64;
figure.spans = HeapAlloc(GetProcessHeap(), 0, figure.spans_size * sizeof(*figure.spans));
- read_figure(&figure, rb.map_desc.pData, rb.map_desc.RowPitch, x, y, w, h, prev);
+ read_figure(&figure, rb.data, rb.pitch, x, y, w, h, prev);
deserialize_figure(&ref_figure, (BYTE *)ref);
span = w * h;
@@ -679,7 +682,7 @@ static BOOL compare_figure(IDXGISurface *surface, unsigned int x, unsigned int y
if (diff > max_diff)
{
trace("diff %u > max_diff %u.\n", diff, max_diff);
- read_figure(&figure, rb.map_desc.pData, rb.map_desc.RowPitch, x, y, w, h, prev);
+ read_figure(&figure, rb.data, rb.pitch, x, y, w, h, prev);
serialize_figure(&figure);
}
--
2.20.1
2
1
[PATCH 06/12] d2d1/tests: Create a Direct2D render target in init_test_context_().
by Henri Verbeet 15 Jan '21
by Henri Verbeet 15 Jan '21
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Creating the render target is not supposed to fail.
- Add proper line information for ok calls.
- Get rid of superfluous render target reference counting.
dlls/d2d1/tests/d2d1.c | 131 +++++++++++++----------------------------
1 file changed, 40 insertions(+), 91 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 3fa3b1a9acd..c8c0e83df1c 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -48,6 +48,7 @@ struct d2d1_test_context
HWND window;
IDXGISwapChain *swapchain;
IDXGISurface *surface;
+ ID2D1RenderTarget *rt;
};
struct resource_readback
@@ -790,6 +791,14 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
#define release_test_context(ctx) release_test_context_(__LINE__, ctx)
static void release_test_context_(unsigned int line, struct d2d1_test_context *ctx)
{
+ ID2D1Factory *factory;
+ ULONG ref;
+
+ ID2D1RenderTarget_GetFactory(ctx->rt, &factory);
+ ID2D1RenderTarget_Release(ctx->rt);
+ ref = ID2D1Factory_Release(factory);
+ ok_(__FILE__, line)(!ref, "Factory has %u references left.\n", ref);
+
IDXGISurface_Release(ctx->surface);
IDXGISwapChain_Release(ctx->swapchain);
DestroyWindow(ctx->window);
@@ -816,6 +825,9 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
hr = IDXGISwapChain_GetBuffer(ctx->swapchain, 0, &IID_IDXGISurface, (void **)&ctx->surface);
ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
+ ctx->rt = create_render_target(ctx->surface);
+ ok_(__FILE__, line)(!!ctx->rt, "Failed to create render target.\n");
+
return TRUE;
}
@@ -1148,9 +1160,7 @@ static void test_clip(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_GetDpi(rt, &dpi_x, &dpi_y);
ok(dpi_x == 96.0f, "Got unexpected dpi_x %.8e.\n", dpi_x);
ok(dpi_y == 96.0f, "Got unexpected dpi_x %.8e.\n", dpi_y);
@@ -1316,7 +1326,6 @@ static void test_clip(void)
match = compare_surface(ctx.surface, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
ok(match, "Surface does not match.\n");
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -1354,8 +1363,7 @@ static void test_state_block(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown **)&dwrite_factory);
ok(SUCCEEDED(hr), "Failed to create dwrite factory, hr %#x.\n", hr);
@@ -1578,7 +1586,6 @@ static void test_state_block(void)
refcount = IDWriteRenderingParams_Release(text_rendering_params1);
ok(!refcount, "Rendering params %u references left.\n", refcount);
ID2D1Factory_Release(factory);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -1598,9 +1605,7 @@ static void test_color_brush(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -1666,7 +1671,6 @@ static void test_color_brush(void)
ok(match, "Surface does not match.\n");
ID2D1SolidColorBrush_Release(brush);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -1726,9 +1730,7 @@ static void test_bitmap_brush(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -1821,6 +1823,7 @@ static void test_bitmap_brush(void)
ID2D1RenderTarget_SetTransform(rt, &tmp_matrix);
ID2D1DeviceContext_Release(context);
+ ID2D1Image_Release(image);
}
/* Creating a brush with a NULL bitmap crashes on Vista, but works fine on
@@ -2061,7 +2064,6 @@ static void test_bitmap_brush(void)
ID2D1BitmapBrush_Release(brush);
refcount = ID2D1Bitmap_Release(bitmap);
ok(!refcount, "Bitmap has %u references left.\n", refcount);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -2125,9 +2127,7 @@ static void test_linear_brush(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -2255,7 +2255,6 @@ static void test_linear_brush(void)
ID2D1LinearGradientBrush_Release(brush);
refcount = ID2D1GradientStopCollection_Release(gradient);
ok(!refcount, "Gradient has %u references left.\n", refcount);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -2319,9 +2318,7 @@ static void test_radial_brush(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -2457,7 +2454,6 @@ static void test_radial_brush(void)
ID2D1RadialGradientBrush_Release(brush);
refcount = ID2D1GradientStopCollection_Release(gradient);
ok(!refcount, "Gradient has %u references left.\n", refcount);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -2592,7 +2588,6 @@ static void test_path_geometry(void)
BOOL match, contains;
D2D1_COLOR_F color;
D2D1_RECT_F rect;
- ULONG refcount;
UINT32 count;
HRESULT hr;
@@ -2913,8 +2908,7 @@ static void test_path_geometry(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -3633,9 +3627,7 @@ static void test_path_geometry(void)
ID2D1PathGeometry_Release(geometry);
ID2D1SolidColorBrush_Release(brush);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -4002,9 +3994,7 @@ static void test_bitmap_formats(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
bitmap_desc.dpiX = 96.0f;
bitmap_desc.dpiY = 96.0f;
for (i = 0; i < ARRAY_SIZE(bitmap_formats); ++i)
@@ -4028,7 +4018,6 @@ static void test_bitmap_formats(void)
}
}
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -4059,9 +4048,7 @@ static void test_alpha_mode(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
set_size_u(&size, 4, 4);
@@ -4146,7 +4133,6 @@ static void test_alpha_mode(void)
match = compare_surface(ctx.surface, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
ok(match, "Surface does not match.\n");
- ID2D1RenderTarget_Release(rt);
rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
rt_desc.pixelFormat.format = DXGI_FORMAT_UNKNOWN;
rt_desc.pixelFormat.alphaMode = D2D1_ALPHA_MODE_IGNORE;
@@ -4520,9 +4506,7 @@ static void test_bitmap_updates(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
ID2D1RenderTarget_BeginDraw(rt);
@@ -4583,7 +4567,6 @@ static void test_bitmap_updates(void)
ok(match, "Surface does not match.\n");
ID2D1Bitmap_Release(bitmap);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -4616,8 +4599,7 @@ static void test_opacity_brush(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -4750,9 +4732,7 @@ static void test_opacity_brush(void)
ID2D1BitmapBrush_Release(bitmap_brush);
ID2D1BitmapBrush_Release(opacity_brush);
ID2D1SolidColorBrush_Release(color_brush);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -4782,7 +4762,6 @@ static void test_create_target(void)
if (!init_test_context(&ctx))
return;
-
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -5761,9 +5740,7 @@ static void test_gradient(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
stops2[0].position = 0.5f;
set_color(&stops2[0].color, 1.0f, 1.0f, 0.0f, 1.0f);
stops2[1] = stops2[0];
@@ -5788,7 +5765,6 @@ static void test_gradient(void)
}
ID2D1GradientStopCollection_Release(gradient);
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
@@ -5810,15 +5786,13 @@ static void test_draw_geometry(void)
D2D1_ELLIPSE ellipse;
D2D1_COLOR_F color;
D2D1_RECT_F rect;
- ULONG refcount;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -6703,9 +6677,7 @@ static void test_draw_geometry(void)
ok(match, "Figure does not match.\n");
ID2D1SolidColorBrush_Release(brush);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -6725,15 +6697,13 @@ static void test_fill_geometry(void)
D2D1_ELLIPSE ellipse;
D2D1_COLOR_F color;
D2D1_RECT_F rect;
- ULONG refcount;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -7505,9 +7475,7 @@ static void test_fill_geometry(void)
ok(match, "Figure does not match.\n");
ID2D1SolidColorBrush_Release(brush);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -7649,14 +7617,12 @@ static void test_layer(void)
ID2D1RenderTarget *rt;
ID2D1Layer *layer;
D2D1_SIZE_F size;
- ULONG refcount;
HRESULT hr;
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -7680,9 +7646,7 @@ static void test_layer(void)
ok(size.height == 600.0f, "Got unexpected height %.8e.\n", size.height);
ID2D1Layer_Release(layer);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -7696,15 +7660,13 @@ static void test_bezier_intersect(void)
ID2D1RenderTarget *rt;
ID2D1Factory *factory;
D2D1_COLOR_F color;
- ULONG refcount;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -7818,9 +7780,7 @@ static void test_bezier_intersect(void)
ok(match, "Figure does not match.\n");
ID2D1SolidColorBrush_Release(brush);
- ID2D1RenderTarget_Release(rt);
- refcount = ID2D1Factory_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory_Release(factory);
release_test_context(&ctx);
}
@@ -8123,10 +8083,7 @@ static void test_bitmap_surface(void)
}
/* DXGI target */
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
- hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
+ hr = ID2D1RenderTarget_QueryInterface(ctx.rt, &IID_ID2D1DeviceContext, (void **)&device_context);
ok(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr);
bitmap = NULL;
@@ -8135,12 +8092,10 @@ static void test_bitmap_surface(void)
check_bitmap_surface((ID2D1Bitmap *)bitmap, TRUE, D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW);
ID2D1Bitmap1_Release(bitmap);
- check_rt_bitmap_surface(rt, TRUE, D2D1_BITMAP_OPTIONS_NONE);
+ check_rt_bitmap_surface(ctx.rt, TRUE, D2D1_BITMAP_OPTIONS_NONE);
ID2D1DeviceContext_Release(device_context);
- ID2D1RenderTarget_Release(rt);
-
/* Bitmap created from DXGI surface. */
hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr);
@@ -8370,9 +8325,7 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
/* DXGI target */
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
-
+ rt = ctx.rt;
hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
ok(SUCCEEDED(hr), "Failed to get device context interface, hr %#x.\n", hr);
ID2D1DeviceContext_GetTarget(device_context, (ID2D1Image **)&bitmap);
@@ -8397,7 +8350,6 @@ static void test_device_context(void)
ok(bitmap == NULL, "Unexpected target instance.\n");
ID2D1DeviceContext_Release(device_context);
- ID2D1RenderTarget_Release(rt);
/* WIC target */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -8895,8 +8847,7 @@ todo_wine
ID2D1RenderTarget_Release(rt);
ID2D1DeviceContext_Release(device_context);
- refcount = ID2D1Factory1_Release(factory);
- ok(!refcount, "Factory has %u references left.\n", refcount);
+ ID2D1Factory1_Release(factory);
release_test_context(&ctx);
}
@@ -9256,8 +9207,7 @@ static void test_wic_bitmap_format(void)
if (!init_test_context(&ctx))
return;
- rt = create_render_target(ctx.surface);
- ok(!!rt, "Failed to create render target.\n");
+ rt = ctx.rt;
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
@@ -9285,7 +9235,6 @@ static void test_wic_bitmap_format(void)
IWICImagingFactory_Release(wic_factory);
CoUninitialize();
- ID2D1RenderTarget_Release(rt);
release_test_context(&ctx);
}
--
2.20.1
2
1
[PATCH 05/12] d2d1/tests: Retrieve the swapchain back-buffer in init_test_context_().
by Henri Verbeet 15 Jan '21
by Henri Verbeet 15 Jan '21
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Retrieving the back-buffer is not supposed to fail.
- Add line information to the IDXGISwapChain_GetBuffer() check in
init_test_context_().
dlls/d2d1/tests/d2d1.c | 507 +++++++++++++++++------------------------
1 file changed, 212 insertions(+), 295 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 545f5dc20a7..3fa3b1a9acd 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -47,6 +47,7 @@ struct d2d1_test_context
ID3D10Device1 *device;
HWND window;
IDXGISwapChain *swapchain;
+ IDXGISurface *surface;
};
struct resource_readback
@@ -789,6 +790,7 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
#define release_test_context(ctx) release_test_context_(__LINE__, ctx)
static void release_test_context_(unsigned int line, struct d2d1_test_context *ctx)
{
+ IDXGISurface_Release(ctx->surface);
IDXGISwapChain_Release(ctx->swapchain);
DestroyWindow(ctx->window);
ID3D10Device1_Release(ctx->device);
@@ -797,6 +799,8 @@ static void release_test_context_(unsigned int line, struct d2d1_test_context *c
#define init_test_context(ctx) init_test_context_(__LINE__, ctx)
static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
{
+ HRESULT hr;
+
memset(ctx, 0, sizeof(*ctx));
if (!(ctx->device = create_device()))
@@ -809,6 +813,8 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
ok_(__FILE__, line)(!!ctx->window, "Failed to create test window.\n");
ctx->swapchain = create_swapchain(ctx->device, ctx->window, TRUE);
ok_(__FILE__, line)(!!ctx->swapchain, "Failed to create swapchain.\n");
+ hr = IDXGISwapChain_GetBuffer(ctx->swapchain, 0, &IID_IDXGISurface, (void **)&ctx->surface);
+ ok_(__FILE__, line)(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
return TRUE;
}
@@ -1125,7 +1131,6 @@ static void test_clip(void)
D2D1_MATRIX_3X2_F matrix;
D2D1_SIZE_U pixel_size;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
D2D1_POINT_2F point;
D2D1_COLOR_F color;
float dpi_x, dpi_y;
@@ -1143,9 +1148,7 @@ static void test_clip(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetDpi(rt, &dpi_x, &dpi_y);
@@ -1244,7 +1247,7 @@ static void test_clip(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9");
+ match = compare_surface(ctx.surface, "035a44d4198d6e422e9de6185b5b2c2bac5e33c9");
ok(match, "Surface does not match.\n");
/* Fractional clip rectangle coordinates, aliased mode. */
@@ -1310,11 +1313,10 @@ static void test_clip(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
+ match = compare_surface(ctx.surface, "cb418ec4a7c8407b5e36db06fc6292a06bb8476c");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -1327,7 +1329,6 @@ static void test_state_block(void)
struct d2d1_test_context ctx;
ID2D1Factory1 *factory1;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
ULONG refcount;
HRESULT hr;
@@ -1353,9 +1354,7 @@ static void test_state_block(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown **)&dwrite_factory);
@@ -1580,7 +1579,6 @@ static void test_state_block(void)
ok(!refcount, "Rendering params %u references left.\n", refcount);
ID2D1Factory_Release(factory);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -1592,7 +1590,6 @@ static void test_color_brush(void)
struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
D2D1_RECT_F rect;
float opacity;
HRESULT hr;
@@ -1601,9 +1598,7 @@ static void test_color_brush(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -1667,12 +1662,11 @@ static void test_color_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb");
+ match = compare_surface(ctx.surface, "6d1218fca5e21fb7e287b3a439d60dbc251f5ceb");
ok(match, "Surface does not match.\n");
ID2D1SolidColorBrush_Release(brush);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -1691,7 +1685,6 @@ static void test_bitmap_brush(void)
ID2D1BitmapBrush *brush;
D2D1_SIZE_F image_size;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F color;
ID2D1Image *image;
@@ -1733,9 +1726,7 @@ static void test_bitmap_brush(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -1813,7 +1804,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
+ match = compare_surface(ctx.surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1825,7 +1816,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
+ match = compare_surface(ctx.surface, "95675fbc4a16404c9568d41b14e8f6be64240998");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_SetTransform(rt, &tmp_matrix);
@@ -1913,7 +1904,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
+ match = compare_surface(ctx.surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
ok(match, "Surface does not match.\n");
/* Invalid interpolation mode. */
@@ -1931,7 +1922,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
- match = compare_surface(surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
+ match = compare_surface(ctx.surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1943,7 +1934,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "59043096393570ad800dbcbfdd644394b79493bd");
+ match = compare_surface(ctx.surface, "59043096393570ad800dbcbfdd644394b79493bd");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -1972,7 +1963,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "b4b775afecdae2d26642001f4faff73663bb8b31");
+ match = compare_surface(ctx.surface, "b4b775afecdae2d26642001f4faff73663bb8b31");
ok(match, "Surface does not match.\n");
ID2D1Bitmap_Release(bitmap);
@@ -2021,7 +2012,7 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
+ match = compare_surface(ctx.surface, "cf7b90ba7b139fdfbe9347e1907d635cfb4ed197");
ok(match, "Surface does not match.\n");
if (SUCCEEDED(ID2D1BitmapBrush_QueryInterface(brush, &IID_ID2D1BitmapBrush1, (void **)&brush1)))
@@ -2071,7 +2062,6 @@ static void test_bitmap_brush(void)
refcount = ID2D1Bitmap_Release(bitmap);
ok(!refcount, "Bitmap has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -2086,7 +2076,6 @@ static void test_linear_brush(void)
struct d2d1_test_context ctx;
struct resource_readback rb;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F colour;
D2D1_POINT_2F p;
@@ -2136,9 +2125,7 @@ static void test_linear_brush(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -2180,7 +2167,7 @@ static void test_linear_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx.surface, &rb);
for (i = 0; i < ARRAY_SIZE(test1); ++i)
{
DWORD colour;
@@ -2253,7 +2240,7 @@ static void test_linear_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx.surface, &rb);
for (i = 0; i < ARRAY_SIZE(test2); ++i)
{
DWORD colour;
@@ -2269,7 +2256,6 @@ static void test_linear_brush(void)
refcount = ID2D1GradientStopCollection_Release(gradient);
ok(!refcount, "Gradient has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -2284,7 +2270,6 @@ static void test_radial_brush(void)
struct d2d1_test_context ctx;
struct resource_readback rb;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F colour;
D2D1_POINT_2F p;
@@ -2334,9 +2319,7 @@ static void test_radial_brush(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f);
@@ -2384,7 +2367,7 @@ static void test_radial_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx.surface, &rb);
for (i = 0; i < ARRAY_SIZE(test1); ++i)
{
DWORD colour;
@@ -2459,7 +2442,7 @@ static void test_radial_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- get_surface_readback(surface, &rb);
+ get_surface_readback(ctx.surface, &rb);
for (i = 0; i < ARRAY_SIZE(test2); ++i)
{
DWORD colour;
@@ -2475,7 +2458,6 @@ static void test_radial_brush(void)
refcount = ID2D1GradientStopCollection_Release(gradient);
ok(!refcount, "Gradient has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -2606,7 +2588,6 @@ static void test_path_geometry(void)
ID2D1PathGeometry *geometry;
ID2D1Geometry *tmp_geometry;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
BOOL match, contains;
D2D1_COLOR_F color;
@@ -2932,9 +2913,7 @@ static void test_path_geometry(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -3320,7 +3299,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "3aace1b22aae111cb577614fed16e4eb1650dba5");
+ match = compare_surface(ctx.surface, "3aace1b22aae111cb577614fed16e4eb1650dba5");
ok(match, "Surface does not match.\n");
/* Edge test. */
@@ -3401,7 +3380,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "bfb40a1f007694fa07dbd3b854f3f5d9c3e1d76b");
+ match = compare_surface(ctx.surface, "bfb40a1f007694fa07dbd3b854f3f5d9c3e1d76b");
ok(match, "Surface does not match.\n");
ID2D1TransformedGeometry_Release(transformed_geometry);
ID2D1PathGeometry_Release(geometry);
@@ -3461,7 +3440,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X"
"FBddFxYWXRYYFlsXGBdaFhoWWRYcFlgVHhVXFSAVVhQiFFUUIxRVEyYTVBIoElQRKhFUECwQUxAu"
@@ -3471,7 +3450,7 @@ static void test_path_geometry(void)
"EBVnFBAUaRQOFGsTDhJvEgwSchAMEHYPCg96DQoMggEICgiLAQQIBJQBCJgBCJkBBpoBBpoBBpoB"
"BpsBBJwBBJwBBJwBBJwBBJ0BAp4BAp4BAp4BAp4BAp4BAp4BAp4BAgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 226, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 226, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEECASLAQgKCIEBDQoMew8KD3YQDBByEgwSbhMOEmwUDhRpFBAUZxUQFWUVEhVjFhIWYRYUFl8X"
"FBddFxYWXRYYFlsXGBdaFhoWWRYcFlgVHhVXFSAVVhQiFFUUIxRVEyYTVBIoElQRKhFUECwQUxAu"
@@ -3481,7 +3460,7 @@ static void test_path_geometry(void)
"EBVnFBAUaRQOFGsTDhJvEgwSchAMEHYPCg96DQoMggEICgiLAQQIBJQBCJgBCJkBBpoBBpoBBpoB"
"BpsBBJwBBJwBBJwBBJwBBJ0BAp4BAp4BAp4BAp4BAp4BAp4BAp4BAgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 64,
"gVQBwAIBWgHlAQFYAecBAVYB6QEBVAHrAQEjDCMB7AECHhQeAu0BAxoYGgPvAQMWHhYD8QEDFCAU"
"A/MBBBAkEAT0AQUOJw0F9QEGCioKBvcBBggsCAb4AQgFLgUI+QEJATIBCfsBCAIwAgj8AQcFLAUH"
"/QEFCCgIBf4BBAwiDAT/AQIQHBAClwISlwIBPgGAAgI8Av8BAzwD/QEEPAT7AQY6BvkBBzoH+AEI"
@@ -3493,7 +3472,7 @@ static void test_path_geometry(void)
"BfUBBBAlDwTzAQQSIhIE8QEDFh4WA/ABAhkaGQLvAQIcFhwC7QECIBAgAusBASgEKAHpAQFWAecB"
"AVgB5QEBWgHAAgHhUgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 160, 160, 320, 160, 0xff652e89, 64,
"/VUB5QEBWAHnAQFWAekBAVQB6wECIQ8hAe0BAh0VHQLuAQIZGhkD7wEDFh4WA/EBBBMhEwPzAQQQ"
"JQ8F9AEFDCgNBfUBBgoqCgb3AQcHLQcG+QEIBC8ECPkBPAEJ+wEIAy8CCP0BBgYrBQf9AQUJJgkF"
"/wEDDSANBP8BAhEaEQKYAhAXAYACAT4BgAICPQL+AQM8BPwBBTsE+wEGOgb6AQc5B/gBCDgJ9gEJ"
@@ -3557,21 +3536,21 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)transformed_geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM"
"U05STlJOUk5STlFQUFBQUFBQTlRIXD9mMnYqdjJmP1xIVE5QUFBQUFBQUU5STlJOUk5STlNMVExU"
"TFRMVEtWSlZKV0hYSFlGWkZbRFxDXkJfQGE+YzxlOmc4aTZrM28wcix2KHojggEaiwEQlAEImAEI"
"mQEGmgEGmgEGmgEGmwEEnAEEnAEEnAEEnAEEnQECngECngECngECngECngECngECngEC");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 226, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 226, 160, 160, 0xff652e89, 64,
"7xoCngECngECngECngECngECngECngECnQEEnAEEnAEEnAEEnAEEmwEGmgEGmgEGmgEGmQEImAEI"
"lAEQiwEagQEjeyh2LHIwbjNsNmk4ZzplPGM+YUBfQl1DXURbRlpGWUhYSFdKVkpVS1VMVExUTFRM"
"U05STlJOUk5STlFQUFBQUFBQTlRIXD9mMnYqdjJmP1xIVE5QUFBQUFBQUU5STlJOUk5STlNMVExU"
"TFRMVEtWSlZKV0hYSFlGWkZbRFxDXkJfQGE+YzxlOmc4aTZrM28wcix2KHojggEaiwEQlAEImAEI"
"mQEGmgEGmgEGmgEGmwEEnAEEnAEEnAEEnAEEnQECngECngECngECngECngECngECngEC");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 64,
"4VIBwAIBWgHlAQFYAecBAVYB6QEBVAHrAQIhDiIB7QECHRUdAu4BAhkaGQPvAQMWHhYD8QEEEyET"
"A/MBBBAkEAT1AQUMKA0F9QEGCioKBvcBBwctBwb5AQgELwQI+QEJATIBCfsBRP0BQ/0BQv8BQf8B"
"QIECP4ACQIACQf4BQ/wBRPsBRvoBR/gBSPcBSvYBS/QBTPMBTvIBTvIBT/ABUPABUe4BUu4BUu4B"
@@ -3580,7 +3559,7 @@ static void test_path_geometry(void)
"RPsBCQEyAQn6AQgELwQI+AEHBy0GB/cBBgoqCgb2AQUMKA0F9AEEECUPBPMBBBIiEwPxAQMWHhYD"
"8AECGRoZA+4BAh0VHQLsAQIhDiIB6wEBVAHpAQFWAecBAVgB5QEBWgHAAgEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 160, 160, 320, 160, 0xff652e89, 64,
"gVQBXAHjAQFaAeUBAVgB5wEBVgHpAQEpAikB6wECIBAgAu0BAhwWHALvAQIZGhkC8AEDFh4WA/EB"
"BBIiEgTzAQQPJRAE9QEFDCgMBfYBBgoqCgb3AQcGLgYH+QEIAzADCPoBRvsBRPwBRP0BQv8BQIAC"
"QIECPoECQP8BQv0BRPwBRPsBRvkBSPgBSPcBSvUBTPQBTPMBTvIBTvEBUPABUO8BUu4BUu4BUu4B"
@@ -3624,7 +3603,7 @@ static void test_path_geometry(void)
ID2D1RenderTarget_FillGeometry(rt, (ID2D1Geometry *)geometry, (ID2D1Brush *)brush, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "a875e68e0cb9c055927b1b50b879f90b24e38470");
+ match = compare_surface(ctx.surface, "a875e68e0cb9c055927b1b50b879f90b24e38470");
ok(match, "Surface does not match.\n");
ID2D1PathGeometry_Release(geometry);
@@ -3657,7 +3636,6 @@ static void test_path_geometry(void)
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -3994,7 +3972,6 @@ static void test_bitmap_formats(void)
struct d2d1_test_context ctx;
D2D1_SIZE_U size = {4, 4};
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i, j;
HRESULT hr;
@@ -4025,9 +4002,7 @@ static void test_bitmap_formats(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
bitmap_desc.dpiX = 96.0f;
@@ -4054,7 +4029,6 @@ static void test_bitmap_formats(void)
}
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -4066,7 +4040,6 @@ static void test_alpha_mode(void)
ID2D1BitmapBrush *bitmap_brush;
struct d2d1_test_context ctx;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Bitmap *bitmap;
D2D1_COLOR_F color;
D2D1_RECT_F rect;
@@ -4086,9 +4059,7 @@ static void test_alpha_mode(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -4115,7 +4086,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "48c41aff3a130a17ee210866b2ab7d36763934d5");
+ match = compare_surface(ctx.surface, "48c41aff3a130a17ee210866b2ab7d36763934d5");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4123,7 +4094,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "6487e683730fb5a77c1911388d00b04664c5c4e4");
+ match = compare_surface(ctx.surface, "6487e683730fb5a77c1911388d00b04664c5c4e4");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4131,7 +4102,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "7a35ba09e43cbaf591388ff1ef8de56157630c98");
+ match = compare_surface(ctx.surface, "7a35ba09e43cbaf591388ff1ef8de56157630c98");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4172,7 +4143,7 @@ static void test_alpha_mode(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
+ match = compare_surface(ctx.surface, "14f8ac64b70966c7c3c6281c59aaecdb17c3b16a");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_Release(rt);
@@ -4183,7 +4154,7 @@ static void test_alpha_mode(void)
rt_desc.dpiY = 0.0f;
rt_desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
rt_desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
- rt = create_render_target_desc(surface, &rt_desc);
+ rt = create_render_target_desc(ctx.surface, &rt_desc);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -4210,7 +4181,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, NULL);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "b44510bf2d2e61a8d7c0ad862de49a471f1fd13f");
+ match = compare_surface(ctx.surface, "b44510bf2d2e61a8d7c0ad862de49a471f1fd13f");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4218,7 +4189,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "2184f4a9198fc1de09ac85301b7a03eebadd9b81");
+ match = compare_surface(ctx.surface, "2184f4a9198fc1de09ac85301b7a03eebadd9b81");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4226,7 +4197,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Clear(rt, &color);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "6527ec83b4039c895b50f9b3e144fe0cf90d1889");
+ match = compare_surface(ctx.surface, "6527ec83b4039c895b50f9b3e144fe0cf90d1889");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4267,7 +4238,7 @@ static void test_alpha_mode(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "465f5a3190d7bde408b3206b4be939fb22f8a3d6");
+ match = compare_surface(ctx.surface, "465f5a3190d7bde408b3206b4be939fb22f8a3d6");
ok(match, "Surface does not match.\n");
refcount = ID2D1Bitmap_Release(bitmap);
@@ -4275,7 +4246,6 @@ static void test_alpha_mode(void)
ID2D1SolidColorBrush_Release(color_brush);
ID2D1BitmapBrush_Release(bitmap_brush);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -4286,7 +4256,7 @@ static void test_shared_bitmap(void)
D2D1_RENDER_TARGET_PROPERTIES desc;
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1RenderTarget *rt1, *rt2, *rt3;
- IDXGISurface *surface1, *surface2;
+ IDXGISurface *surface2;
ID2D1Factory *factory1, *factory2;
IWICImagingFactory *wic_factory;
ID2D1Bitmap *bitmap1, *bitmap2;
@@ -4305,8 +4275,6 @@ static void test_shared_bitmap(void)
window2 = create_window();
swapchain2 = create_swapchain(ctx.device, window2, TRUE);
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface1);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -4341,7 +4309,7 @@ static void test_shared_bitmap(void)
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
/* DXGI surface render targets with the same device and factory. */
- hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, surface1, &desc, &rt1);
+ hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory1, ctx.surface, &desc, &rt1);
ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr);
hr = ID2D1RenderTarget_CreateBitmap(rt1, size, NULL, 0, &bitmap_desc, &bitmap1);
check_bitmap_surface(bitmap1, TRUE, 0);
@@ -4521,7 +4489,6 @@ static void test_shared_bitmap(void)
IWICBitmap_Release(wic_bitmap2);
IWICBitmap_Release(wic_bitmap1);
IDXGISurface_Release(surface2);
- IDXGISurface_Release(surface1);
IDXGISwapChain_Release(swapchain2);
ID3D10Device1_Release(device2);
release_test_context(&ctx);
@@ -4534,7 +4501,6 @@ static void test_bitmap_updates(void)
D2D1_BITMAP_PROPERTIES bitmap_desc;
struct d2d1_test_context ctx;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
D2D1_RECT_U dst_rect;
ID2D1Bitmap *bitmap;
D2D1_COLOR_F color;
@@ -4554,9 +4520,7 @@ static void test_bitmap_updates(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -4615,12 +4579,11 @@ static void test_bitmap_updates(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "cb8136c91fbbdc76bb83b8c09edc1907b0a5d0a6");
+ match = compare_surface(ctx.surface, "cb8136c91fbbdc76bb83b8c09edc1907b0a5d0a6");
ok(match, "Surface does not match.\n");
ID2D1Bitmap_Release(bitmap);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -4633,7 +4596,6 @@ static void test_opacity_brush(void)
struct d2d1_test_context ctx;
D2D1_MATRIX_3X2_F matrix;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
ID2D1Bitmap *bitmap;
D2D1_COLOR_F color;
@@ -4654,9 +4616,7 @@ static void test_opacity_brush(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -4742,7 +4702,7 @@ static void test_opacity_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(hr == D2DERR_INCOMPATIBLE_BRUSH_TYPES, "Got unexpected hr %#x.\n", hr);
- match = compare_surface(surface, "7141c6c7b3decb91196428efb1856bcbf9872935");
+ match = compare_surface(ctx.surface, "7141c6c7b3decb91196428efb1856bcbf9872935");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
@@ -4784,7 +4744,7 @@ static void test_opacity_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "c3a5802d1750efa3e9122c1a92f6064df3872732");
+ match = compare_surface(ctx.surface, "c3a5802d1750efa3e9122c1a92f6064df3872732");
ok(match, "Surface does not match.\n");
ID2D1BitmapBrush_Release(bitmap_brush);
@@ -4793,7 +4753,6 @@ static void test_opacity_brush(void)
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -4802,7 +4761,6 @@ static void test_create_target(void)
struct d2d1_test_context ctx;
ID2D1Factory *factory;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
HRESULT hr;
static const struct
{
@@ -4824,8 +4782,6 @@ static void test_create_target(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -4846,7 +4802,7 @@ static void test_create_target(void)
desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
- hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, surface, &desc, &rt);
+ hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, ctx.surface, &desc, &rt);
ok(hr == create_dpi_tests[i].hr, "Wrong return code, hr %#x, expected %#x, test %u.\n", hr,
create_dpi_tests[i].hr, i);
@@ -4876,7 +4832,6 @@ static void test_create_target(void)
}
ID2D1Factory_Release(factory);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -4916,7 +4871,6 @@ static void test_draw_text_layout(void)
D2D1_RENDER_TARGET_PROPERTIES desc;
ID2D1Factory *factory, *factory2;
ID2D1RenderTarget *rt, *rt2;
- IDXGISurface *surface;
HRESULT hr;
IDWriteFactory *dwrite_factory;
IDWriteTextFormat *text_format;
@@ -4933,8 +4887,6 @@ static void test_draw_text_layout(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -4951,10 +4903,10 @@ static void test_draw_text_layout(void)
desc.usage = D2D1_RENDER_TARGET_USAGE_NONE;
desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
- hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, surface, &desc, &rt);
+ hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, ctx.surface, &desc, &rt);
ok(SUCCEEDED(hr), "Failed to create a target, hr %#x.\n", hr);
- hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory2, surface, &desc, &rt2);
+ hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory2, ctx.surface, &desc, &rt2);
ok(SUCCEEDED(hr), "Failed to create a target, hr %#x.\n", hr);
hr = DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, &IID_IDWriteFactory, (IUnknown **)&dwrite_factory);
@@ -5038,7 +4990,6 @@ todo_wine
ID2D1Factory_Release(factory);
ID2D1Factory_Release(factory2);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -5802,7 +5753,6 @@ static void test_gradient(void)
D2D1_GRADIENT_STOP stops[3], stops2[3];
struct d2d1_test_context ctx;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
D2D1_COLOR_F color;
unsigned int i;
UINT32 count;
@@ -5811,9 +5761,7 @@ static void test_gradient(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
stops2[0].position = 0.5f;
@@ -5842,7 +5790,6 @@ static void test_gradient(void)
ID2D1GradientStopCollection_Release(gradient);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -5858,7 +5805,6 @@ static void test_draw_geometry(void)
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_POINT_2F p0, p1;
D2D1_ELLIPSE ellipse;
@@ -5871,9 +5817,7 @@ static void test_draw_geometry(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -5920,18 +5864,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQUFBQUFBQUFDoYQAA");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQUFBQUFBQUFDoYQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
"xjIUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUxjIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 2,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 2,
"zjECnQETjAEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
"igEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEVigEV"
@@ -5939,18 +5883,18 @@ static void test_draw_geometry(void)
"igEVigEVigEVigEVjAETnQECzjEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "5mAUjAEUjAEUjAEUjAEUhmIA");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "5mAUjAEUjAEUjAEUjAEUhmIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "vmBkPGQ8ZDxkPGTeYQAA");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "vmBkPGQ8ZDxkPGTeYQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
"5i4UjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUhjAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -5959,18 +5903,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 10,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 10,
"hDAYgwEieyh1LnAybBcIF2gWDhZkFhIWYRUWFV4VGhVbFRwVWRUeFVcVIBVVFCQUUxQmFFEUKBRP"
"FSgVTRUqFUwULBRLFC4USRQwFEgUMBRHFDIURhQyFEUUNBREFDQUQxQ2FEIUNhRBFDgUQBQ4FEAU"
"OBQ/FDoUPhQ6FD4UOhQ+FDoUPhQ6FD0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
@@ -6013,18 +5957,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
"3C4oaUZVUExYRlxCHCgcPxU4FT0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6033,18 +5977,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FD0VOBU/YEJcRlhMUFVG7S8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 8,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 8,
"3C4obT5dSFRQTlRKGCgYRhYwFkMVNBVBFTYVPxU5FD4UOhQ9FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6053,18 +5997,18 @@ static void test_draw_geometry(void)
"PBQ8FDwUPRQ6FD4UOhQ/FTYVQRU0FUMWMBZGWEpVTVBTSltA8C8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
"3C4oZU5NWERgP2I9HigePBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6107,18 +6051,18 @@ static void test_draw_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 16,
"hDAYgwEieyh1LnAybBcIF2gWDhZkFhIWYRUWFV4WGRVbFRwVWRUeFVcVIBVVFSMUUxQmFFEVJxRP"
"FSgVTRUqFUwULBRLFC4USRUvFEgUMBRHFDIURhQyFEUUNBREFDQUQxQ2FEIUNhRBFDgUQBQ4FEAU"
"OBQ/FTkUPhQ6FD4UOhQ+FDoUPhQ6FD0UPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
@@ -6127,18 +6071,18 @@ static void test_draw_geometry(void)
"FRwVWxUaFV4VFhVhFhIWZBYOFmgWChZsMnAudCp6IoMBGIQw");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 16,
"3C4obzpjQF5EWkhXFSAVVRQkFFMUJhRRFCgUTxQqFE0VKhVMFCwUSxQuFEoULhVIFDAUSBQwFUYU"
"MhRGFDIURRQ0FEQUNBRDFTQVQhQ2FEIUNhRCFDYUQRQ4FEAUOBRAFDgUQBQ4FD8UOhQ+FDoUPhQ6"
"FD4UOhQ+FDoUPhQ6FD0VOxQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6147,18 +6091,18 @@ static void test_draw_geometry(void)
"LhRLFCwUTBUrFE0UKhRPFCgUURQmFFMUJBRVSldIWUZdQWI78i8A");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "iGIQjgEUjAEUjgEQiGIA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "yGBQSGA+ZDxkPmDgYQAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
"iDAQjgEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEUjAEU"
"jAEUjAEUjAEUjAEUjAEUjAEUjAEUjgEQiDAA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 8,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 8,
"9i80ZERWUExYRV5AHCocPRY4FjwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6250,18 +6194,18 @@ static void test_draw_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0, "");
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0, "q2MKlgEKq2MA");
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0, "q2MKlgEKq2MA");
todo_wine ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "iGNQUFCIYwAA");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "iGNQUFCIYwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0,
"qyIKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKQQpLCkEKSwqWAQqW"
@@ -6269,9 +6213,9 @@ static void test_draw_geometry(void)
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqW"
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQrLIwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0, "4GLAAuBi");
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "4GLAAuBi");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
"qyIKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEK"
"lgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKlgEKSwpBCksKQQqWAQqWAQqW"
@@ -6280,7 +6224,7 @@ static void test_draw_geometry(void)
"AQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQqWAQrLIwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0,
"rycCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEKAgqKAQoCCokBCgQKiAEKBAqHAQoGCoYBCgYKhQEKCAqEAQoICoMBCgoKggEKCgqBAQoM"
"CoABCgwKfwoOCn4KDgp9ChAKfAoQCnsKEgp6ChIKeQoUCngKFAp3ChYKdgoWCnUKGAp0ChgKcwoa"
@@ -6289,7 +6233,7 @@ static void test_draw_geometry(void)
"CjYKVQo4ClQKOApTCjoKUgo6ClEKPApQCjwKTwo+Ck4KPgpNCkAKTApACksKQgpKCkIKSQpECkgK"
"RApHCkYKozIA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0,
"ozIKRgpHCkQKSApECkkKQgpKCkIKSwpACkwKQApNCj4KTgo+Ck8KPApQCjwKUQo6ClIKOgpTCjgK"
"VAo4ClUKNgpWCjYKVwo0ClgKNApZCjIKWgoyClsKMApcCjAKXQouCl4KLgpfCiwKYAosCmEKKgpi"
"CioKYwooCmQKKAplCiYKZgomCmcKJApoCiQKaQoiCmoKIgprCiAKbAogCm0KHgpuCh4KbwocCnAK"
@@ -6298,7 +6242,7 @@ static void test_draw_geometry(void)
"CgIKiwEUjAEUjQESjgESjwEQkAEQkQEOkgEOkwEMlAEMlQEKlgEKlwEImAEImQEGmgEGmwEEnAEE"
"nQECngECrycA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
"rycCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEKAgqKAQoCCokBCgQKiAEKBAqHAQoGCoYBCgYKhQEKCAqEAQoICoMBCgoKggEKCgqBAQoM"
"CoABCgwKfwoOCn4KDgp9ChAKfAoQCnsKEgp6ChIKeQoUCngKFAp3ChYKdgoWCnUKGAp0ChgKcwoa"
@@ -6307,7 +6251,7 @@ static void test_draw_geometry(void)
"CjYKVQo4ClQKOApTCjoKUgo6ClEKPApQCjwKTwo+Ck4KPgpNCkAKTApACksKQgpKCkIKSQpECkgK"
"RApHWkZagzEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
"gzFaRlpHCkQKSApECkkKQgpKCkIKSwpACkwKQApNCj4KTgo+Ck8KPApQCjwKUQo6ClIKOgpTCjgK"
"VAo4ClUKNgpWCjYKVwo0ClgKNApZCjIKWgoyClsKMApcCjAKXQouCl4KLgpfCiwKYAosCmEKKgpi"
"CioKYwooCmQKKAplCiYKZgomCmcKJApoCiQKaQoiCmoKIgprCiAKbAogCm0KHgpuCh4KbwocCnAK"
@@ -6362,7 +6306,7 @@ static void test_draw_geometry(void)
ID2D1RectangleGeometry_Release(rect_geometry[1]);
ID2D1RectangleGeometry_Release(rect_geometry[0]);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6370,7 +6314,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
"8XYGtQIOrAIXpAIfmwIokwIwigI4gwJA+gFJ8gFR6QEzAiXhATMKJdgBMxMl0AEzGyXHATMkJb8B"
"MysmtgEzNCWvATM8JaYBM0UlngEzTSWVATNWJY0BM14lhAEzZyV8M28lczN4JWszgAElYjOIASZa"
"M5ABJVgtmQElWCWhASVYJaEBJVgloQElWCWhASVYJaEBJVgloQElWCWhASVYJaEBJVglmQEtWCWQ"
@@ -6378,7 +6322,7 @@ static void test_draw_geometry(void)
"KzO/ASUkM8cBJRsz0AElEzPYASUKM+EBJQIz6QFR8gFJ+gFAgwI4igIwkwIomwIfpAIXrAIOtQIG"
"8XYA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
"ujEBngECnQEDnQEEmwEFmgEHmQEHmAEIlwEKlgEKlQELlAENkwENkgEOkQEQjwERjwESjQETjAEU"
"jAEKAQqKAQoCCokBCgMKiQEKBAqHAQoFCoYBCgYKhgEKBwqEAQoICoMBCgkKgwEKCgqBAQoLCoAB"
"Cg0KfgsNCn4KDgp9ChAKewsQCnsKEQp6ChMKeAoUCngKFAp3ChYKdQoXCnUKGApzChkKcgoaCnIK"
@@ -6397,7 +6341,7 @@ static void test_draw_geometry(void)
"CoMBCggKhAEKBwqGAQoGCoYBCgUKhwEKBAqJAQoDCokBCgIKigEKAQqMARSMARONARKPARGPARCR"
"AQ6SAQ2TAQ2UAQuVAQqWAQqXAQiYAQeZAQeaAQWbAQSdAQOdAQKeAQG6MQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 64,
"82ICvQIEugIHuAIJtgIKtAINsgIPsAIRrQITrAIVqQIYpwIZpgIbowIeoQIgnwIhnQIkmwImmAIp"
"lgIVARSVAhUDFJICFQUVkAIVBxSPAhUJFIwCFQwUigIVDRWHAhYPFIYCFRIUhAIVFBSBAhUWFf8B"
"FRgU/gEVGhT7ARUcFfkBFR4U9wEWIBT1ARUjFPMBFSQV8AEVJxTvARUpFOwBFisU6gEVLRXoARUv"
@@ -6533,7 +6477,7 @@ static void test_draw_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6541,7 +6485,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6549,7 +6493,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
"vi5kPGQ8ZDxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6557,7 +6501,7 @@ static void test_draw_geometry(void)
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
"yC5aRlpGWjxkPGQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8"
"FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwU"
@@ -6566,7 +6510,7 @@ static void test_draw_geometry(void)
"PBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8FDwUPBQ8ZDxkPGQ8ZDxk3i8A");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 64,
"3SoDYAM6B1gHOgtQCzoPSA87EkASPBc2FzwcLBw8IiAiPWI+Yj5iPhQBOAEUPhQKJgoUPxQ4FEAU"
"OBRAFDgUQBQ4FEAUOBRBFDYUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRDFDQURBQ0FEQUNBREFDQURBQ0"
"FEQUNBREFDQURBQ0FEQUNBREFDQURRQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIU"
@@ -6575,7 +6519,7 @@ static void test_draw_geometry(void)
"NhRCFDYUQhQ2FEEUOBRAFDgUQBQ4FEAUOBRAFDgUPxQKJgoUPhQBOAEUPmI+Yj5iPSIgIjwcLBw8"
"FzYXPBJAEjsPSA86C1ALOgdYBzoDYAPdKgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 1024,
"uxUBnwECngEDnQEEnAEFmwEGmwEGmgEHmQEImAEJlwEKlgELlQEMlQEMlAENkwEOkgEPkQEQkAER"
"VQQ2Ek0KOBJFEDkTPRY6FDUcOxUrJDwYHi09Yj5iP2BAQwkUQDgUFEAUOBRAFDcUQRQ3FEEUNxRC"
"FDYUQhQ2FEIUNhRCFDUUQxQ1FEMUNRRDFDUUQxQ1FEQUNBREFDQURBQ0FEQUNBREFDQURBQ0FEQU"
@@ -6586,7 +6530,7 @@ static void test_draw_geometry(void)
"NgRVEZABEJEBD5IBDpMBDZQBDJUBDJUBC5YBCpcBCZgBCJkBB5oBBpsBBpsBBZwBBJ0BA54BAp8B"
"AbsV");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 1024,
"pBYBngECnQEDnAEEmwEFmgEGmQEGmQEHmAEIlwEJlgEKlQELlAEMkwEMkwENkgEOkQEPkAEQNgRV"
"ETcKTRI4EEUSOhY9EzscNRQ8JCsVPS0eGD5iPmI/YEAUCUNAFBQ4QBQ4FEEUNxRBFDcUQRQ3FEEU"
"NhRCFDYUQhQ2FEMUNRRDFDUUQxQ1FEMUNRRDFDUUQxQ0FEQUNBREFDQURBQ0FEQUNBREFDQURBQ0"
@@ -6597,7 +6541,7 @@ static void test_draw_geometry(void)
"EVUENhCQAQ+RAQ6SAQ2TAQyTAQyUAQuVAQqWAQmXAQiYAQeZAQaZAQaaAQWbAQScAQOdAQKeAQGk"
"FgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 64,
"wCsDmQEHlQELkQEPSwJAEkgLNhc8HCwcPCIgIj1iPmI+Yj4UATgBFD4UCiYKFD8UOBRAFDgUQBQ4"
"FEAUOBRAFDgUQRQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDYUQxQ0FEQUNBREFDQURBQ0FEQUNBREFDQU"
"RBQ0FEQUNBREFDQURBQ0FEUUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRG"
@@ -6607,7 +6551,7 @@ static void test_draw_geometry(void)
"QBI7D0gPOgtQCzoHWAc6A2AD3SoA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 64,
"3SkmcThiRFdOTVhEICAgPhwsHDwXNhc8FDwUOxQ+FDoUPhQ6FD4UOhQ+FDoUPhQ5FEAUOBRAFDgU"
"QBQ4FEAUOBRAFDcUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDUURBQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQzFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYU"
@@ -6616,7 +6560,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNxRAFDgUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDoUPhQ6FD4UOhQ+FDsUPBQ8FzYXPBws"
"HD4gICBEWE1OV0RiOHEm3SkA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 1024,
"zykoczhkRVhQTlpEFx4tPRUrJDwUNRw7FDwVOxQ+FDoUPhQ5FEAUOBRAFDgUQBQ4FEAUOBRBFDcU"
"QRQ3FEEUNhRCFDYUQhQ2FEIUNhRDFDUUQxQ1FEMUNRRDFDUUQxQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQ0FEQUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUU"
@@ -6625,7 +6569,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNhRCFDYUQRQ3FEEUNxRBFDgUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDsVPBQ7HDUUPCQr"
"FT0tHhdEWk5QWEVkOHMozykA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 1024,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 1024,
"6SkobThfRVNQSFpALR4XPSQrFTscNRQ7FTwUOhQ+FDoUPhQ5FEAUOBRAFDgUQBQ4FEAUNxRBFDcU"
"QRQ3FEEUNxRCFDYUQhQ2FEIUNRRDFDUUQxQ1FEMUNRRDFDUUQxQ1FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQ0FEQUNBRFFDMURRQzFEUUMxRFFDMURRQzFEUUMxRFFDMURRQzFEUU"
@@ -6634,7 +6578,7 @@ static void test_draw_geometry(void)
"QhQ2FEIUNhRCFDcUQRQ3FEEUNxRBFDcUQBQ4FEAUOBRAFDgUQBQ5FD4UOhQ+FDoUPBU7FDUcOxUr"
"JD0XHi1AWkhQU0VfOG0o6SkA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 64,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 64,
"3SkmcThiRFdOTVhGHiAgRhQsHDwXNhc8FDwUOxQ+FDoUPhQ6FD4UOhQ+FDoUPhQ5FEAUOBRAFDgU"
"QBQ4FEAUOBRAFDcUQhQ2FEIUNhRCFDYUQhQ2FEIUNhRCFDUURBQ0FEQUNBREFDQURBQ0FEQUNBRE"
"FDQURBQ0FEQUNBREFDQURBQzFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYUMhRGFDIURhQyFEYU"
@@ -6713,7 +6657,7 @@ static void test_draw_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 128,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 128,
"yjIJkQEHBwaIAQUSBYMBBBYEggEEFgSCAQQWBIIBBBYEggEEFgSCAQQWBIIBBBYEggEEFgSCAQQW"
"BIIBBBYEggEEFgSDAQQVBIMBBBUEgwEEFQSDAQQVBIMBBBUEgwEEFQSDAQQVBIMBBBUEgwEEFQSD"
"AQQVBIQBBBQEhAEEFASEAQQTBIUBBBMEhQEEEwSFAQQTBIUBBBMEhQEEEwSGAQQSBIYBBBIEhgEE"
@@ -6722,13 +6666,13 @@ static void test_draw_geometry(void)
"AQaaAQaaAQaaAQabAQWbAQWbAQWbAQWaAQeZAQeZAQeZAQiXAQQBBJYBBAMElQEEAwWRAQUGBY0B"
"BQwFhwEFEgSCAQUXBYABBBoFfgUYBIIBBhEFiAEUpTEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 512,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 512,
"yJIBArkCDa4CGKMCIZoCK5ECM4gCO4ECQ/gBS/EBUesBLAYl5QEsDiPeASwWIdkBLBwh0wEsISHO"
"ASsgKMsBKR4vyAEnHDPIASUaNMsBIxg1mQEFMCIUN54BCygiDzijAREhIgY9qAEYGWGuAR4RXbMB"
"JAhbuQGAAcABesYBc84Ba9YBTvQBP4MCOIoCNI4CM5ACMZICL5QCLZYCK5kCKJsCJ54CI6MCHq8C"
"EraSAQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 512,
+ match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 512,
"xWkCmwEFmAEJlQELlAENkgEOkQEPjwESjQETjAEVigELAQqJAQsCCogBCwQKhwEKBQqGAQoGCoYB"
"CgcKhAEKCAqEAQoIC4IBCgoKggEKCgqBAQoMCoABCgwKfwoNCn8KDgp9Cg8KfQoPCnwKEQp7ChEK"
"egoSCnoKEwp4ChQKeAoUCncLFQp2ChYKdgoWCnYKFwp2ChYKdgoWCncKFgp2ChYKdgoWCncKFQt2"
@@ -6742,7 +6686,7 @@ static void test_draw_geometry(void)
"iQEKAgqJAQoCCooBCgIKiQEKAgqKAQoBCosBCgEKigEKAQqLARSMARSLARSMAROMARONARKOARGO"
"ARGPARCQAQ6RAQ2YAQTEZAAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 1024,
+ match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 1024,
"ytABA7gCCbICD60CFKkCF6cCGqMCHqACIZ0CJJoCJpgCKZUCFgIUkgIWBBWPAhYHFI4CFQoUjAIV"
"DBSKAhUNFYgCFQ8UhwIVERSFAhUTFIMCFRQVgQIUFxSAAhQZFP4BFBoV/AEUHBT7ARQeFPkBFB8V"
"9wEUIRT2ARQjFPQBFSMV8gEVJRTxARUnFPABFCgV7gEUKhTtARQsFOwBFCwV7AEULBTsARUsFOwB"
@@ -6762,7 +6706,6 @@ static void test_draw_geometry(void)
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -6778,7 +6721,6 @@ static void test_fill_geometry(void)
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_ELLIPSE ellipse;
D2D1_COLOR_F color;
@@ -6790,9 +6732,7 @@ static void test_fill_geometry(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -6827,25 +6767,25 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 8,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 8,
"yjIMjwEWhwEcggEgfiR6KHYscy5xMG40azZpOGc6ZTxjPmI+YUBfQl1EXERbRlpGWUhYSFdKVkpV"
"TFRMVExTTlJOUk5STlJOUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5STlJOUk5STlNMVExUTFVK"
"VkpXSFhIWUZaRltEXERdQl9AYT5iPmM8ZTpnOGk2azRuMHEucyx2KHokfiCCARyHARaPAQzKMgAA");
@@ -6885,37 +6825,37 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
"szI6YURZSlROUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5USllEYTqzMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 2,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 2,
"tjI0aDxhQlxGWEpVTFNOUk5RUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFFOUk5TTFVKWEZcQmA+ZzS2MgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
"sDJAWkxSUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFJMWkCwMgAA");
@@ -6955,37 +6895,37 @@ static void test_fill_geometry(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 10,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 10,
"yjIMjwEWhwEcggEgfiR6KHYscy5xMG40azZpOGc6ZTxjPmI+YUBfQl1EXERbRlpGWUhYSFdKVkpV"
"TFRMVExTTlJOUk5STlJOUVBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUU5STlJOUk5STlNMVExUTFVK"
"VkpXSFhIWUZaRltEXERdQl9AYT5iPmM8ZTpnOGk2azRuMHEucyx2KHokfiCCARyHARaPAQzKMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 10,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 10,
"uTIucDJsNmk4ZzplPGM+YUBgQF9CXkJdRFxEW0ZaRllIWEhXSlZKVkpWSlVMVExUTFRMU05STlJO"
"Uk5STlJOUk9QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFFPUU5STlJOUk5STlJOU0xU"
"TFRMVExVSlZKVkpWSldIWEhZRlpGW0RcRF1CXkJfQGBAYT5jPGU6ZzhpNmwycC65MgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 10,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 10,
"vzIiczhhRldMUlBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUkxXRmA6cSS+MgAA");
@@ -7074,43 +7014,43 @@ static void test_fill_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 0,
"7zMCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEWigEWiQEYiAEYhwEahgEahQEchAEcgwEeggEegQEggAEgfyJ+In0kfCR7JnomeSh4KHcq"
"dip1LHQscy5yLnEwcDBvMm4ybTRsNGs2ajZpOGg4ZzpmOmU8ZDxjPmI+YUBgQF9CXkJdRFxEW0Za"
"RllIWEhXSlZKVUxUTFNOUk5RUKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 0,
"qDJQUU5STlNMVExVSlZKV0hYSFlGWkZbRFxEXUJeQl9AYEBhPmI+YzxkPGU6ZjpnOGg4aTZqNms0"
"bDRtMm4ybzBwMHEuci5zLHQsdSp2KncoeCh5JnomeyR8JH0ifiJ/IIABIIEBHoIBHoMBHIQBHIUB"
"GoYBGocBGIgBGIkBFooBFosBFIwBFI0BEo4BEo8BEJABEJEBDpIBDpMBDJQBDJUBCpYBCpcBCJgB"
"CJkBBpoBBpsBBJwBBJ0BAp4BAu8z");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 0,
"7zMCngECnQEEnAEEmwEGmgEGmQEImAEIlwEKlgEKlQEMlAEMkwEOkgEOkQEQkAEQjwESjgESjQEU"
"jAEUiwEWigEWiQEYiAEYhwEahgEahQEchAEcgwEeggEegQEggAEgfyJ+In0kfCR7JnomeSh4KHcq"
"dip1LHQscy5yLnEwcDBvMm4ybTRsNGs2ajZpOGg4ZzpmOmU8ZDxjPmI+YUBgQF9CXkJdRFxEW0Za"
"RllIWEhXSlZKVUxUTFNOUk5RUKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 0,
"qDJQUU5STlNMVExVSlZKV0hYSFlGWkZbRFxEXUJeQl9AYEBhPmI+YzxkPGU6ZjpnOGg4aTZqNms0"
"bDRtMm4ybzBwMHEuci5zLHQsdSp2KncoeCh5JnomeyR8JH0ifiJ/IIABIIEBHoIBHoMBHIQBHIUB"
"GoYBGocBGIgBGIkBFooBFosBFIwBFI0BEo4BEo8BEJABEJEBDpIBDpMBDJQBDJUBCpYBCpcBCJgB"
@@ -7162,18 +7102,18 @@ static void test_fill_geometry(void)
ID2D1RectangleGeometry_Release(rect_geometry[1]);
ID2D1RectangleGeometry_Release(rect_geometry[0]);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
"sIMBA7cCDK8CFKYCHZ4CJJYCLY4CNYUCPv0BRvQBT+wBV+MBYNsBaNIBccoBecEBgQG6AYkBsQGS"
"AakBmgGgAaMBmAGrAY8BtAGHAbwBfsUBfcYBfcYBfcUBfsUBfcYBfcYBfcYBfcYBfcUBfr0BhgG0"
"AY8BrAGXAaMBoAGbAagBkgGwAYsBuAGCAcEBeskBcdIBadoBYOMBWOsBT/QBR/wBPoUCNowCLpUC"
"Jp0CHaYCFa4CDLcCBK+DAQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
"+D0BngEDnQEDnAEEmwEGmgEGmQEHmAEJlwEJlgELlAEMkwENkwEOkQEPkAEQkAERjgESjQETjQEU"
"iwEVigEXiQEXiAEYhwEahgEahQEbhAEdggEeggEegQEgfyF/In0jfCR8JXomeSd5KHcpdip2K3Qs"
"cy5xL3EvcDFuMm4ybTRrNWs1ajdoOGg5ZjplO2U8Yz1iPmFAYEBfQV5DXUNcRVpGWkZZSFdJV0lW"
@@ -7184,7 +7124,7 @@ static void test_fill_geometry(void)
"KXgneSZ6JXwkfCN9In8hfyCBAR6CAR6CAR2EARuFARuFARqHARiIAReJAReKARWLARSNARONARKO"
"ARGQARCQAQ+RAQ6TAQ2TAQyUAQuWAQqWAQmYAQeZAQaaAQabAQScAQOdAQOeAQH4PQAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 32,
"sXkBvgIDvAIEugIHuAIJtgILswINsgIPrwISrQITrAIVqQIYpwIapQIbowIeoQIgngIjnAIkmwIm"
"mAIplgIqlQIskgIvkAIxjQIzjAI1igI3hwI5hgI7hAI9gQJA/wFB/QFE+wFG+QFI9gFK9QFM8wFO"
"8AFQ7wFS7AFV6gFX6AFY5gFb5AFd4gFf3wFh3gFj2wFm2QFn2AFp1QFs0wFu0QFvzwFyzQF0ygF3"
@@ -7312,70 +7252,70 @@ static void test_fill_geometry(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 160, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
- match = compare_figure(surface, 320, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 320, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 0, 160, 160, 0xff652e89, 0,
+ match = compare_figure(ctx.surface, 480, 0, 160, 160, 0xff652e89, 0,
"qDJQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQ"
"UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFCoMgAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 0, 160, 160, 160, 0xff652e89, 16,
"qDICTAJQB0IHUQs4C1IRLBFSGxgbUk5STlNMVExUTFRMVExVSlZKVkpWSlZKVkpXSFhIWEhYSFhI"
"WEhYSFhIWEhYSFlGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZa"
"RllIWEhYSFhIWEhYSFhIWEhYSFhIV0pWSlZKVkpWSlZKVUxUTFRMVExUTFNOUk5SGxgbUhEsEVIL"
"OAtRB0IHUAJMAqgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 160, 160, 160, 160, 0xff652e89, 16,
"qDIBSwRQAkMKUQQ5EVIIKxtTDRkmVExUTFRMVEtVS1VLVkpWSlZKVklXSVdJV0lXSVhIWEhYSFhI"
"WEhYSFhIWEhYSFhIWUdZR1lHWUdZR1lHWUdZR1lHWUdZSFhIWUdZR1lHWUdZR1lHWUdZR1lHWUdZ"
"SFhIWEhYSFhIWEhYSFhIWEhYSFhJV0lXSVdJV0lWSlZKVkpWS1VLVUtUTFRMVExUJhkNUxsrCFIR"
"OQRRCkMCUARLAagy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 320, 160, 160, 160, 0xff652e89, 16,
"qDIESwFRCkMCUhE5BFIbKwhTJhkNVExUTFRMVUtVS1VLVUpWSlZKV0lXSVdJV0lXSVdIWEhYSFhI"
"WEhYSFhIWEhYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdY"
"SFhIWEhYSFhIWEhYSFhIWEhYSFdJV0lXSVdJV0lXSlZKVkpVS1VLVUtVTFRMVExUDRkmUwgrG1IE"
"ORFSAkMKUQFLBKgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 160, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 480, 160, 160, 160, 0xff652e89, 16,
"qDICTAJQB0IHUQs4C1IRLBFSGxgbUk5STlNMVExUTFRMVExVSlZKVkpWSlZKVkpXSFhIWEhYSFhI"
"WEhYSFhIWEhYSFlGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZa"
"RllIWEhYSFhIWEhYSFhIWEhYSFhIV0pWSlZKVkpWSlZKVUxUTFRMVExUTFNOUk5SGxgbUhEsEVIL"
"OAtRB0IHUAJMAqgy");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 0, 320, 160, 160, 0xff652e89, 16,
"pCwYfixuOGNCWUxSUFBQT1JOUk5STlJOUk1UTFRMVExUTFRLVkpWSlZKVkpWSlZJWEhYSFhIWEhY"
"SFhIWEhYSFhIWEdaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpG"
"WkdYSFhIWEhYSFhIWEhYSFhIWEhYSVZKVkpWSlZKVkpWS1RMVExUTFRMVE1STlJOUk5STlJPUFBQ"
"UkxZQmM4bix+GKQs");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 160, 320, 160, 160, 0xff652e89, 16,
"liwZgQErcTllQ1xLVFBQUU9STlJNVExUTFRMVExVS1VLVUpWSlZKVkpXSVdJV0lXSVdIWEhYSFhI"
"WEhYSFhIWEhYSFhIWEdZR1lHWUdZR1lHWUdZR1lHWUdZR1hIWEdZR1lHWUdZR1lHWUdZR1lHWUdZ"
"R1hIWEhYSFhIWEhYSFhIWEhYSFhIV0lXSVdJV0lXSlZKVkpWSlVLVUtVTFRMVExUTFRNUk5ST1FQ"
"UFRLXENlOXErgQEZliwA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 320, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 320, 320, 160, 160, 0xff652e89, 16,
"sSwZeytrOV9DVktRUE9RTlJOUk1UTFRMVExUS1VLVUtVS1ZKVkpWSVdJV0lXSVdJV0lYSFhIWEhY"
"SFhIWEhYSFhIWEhYSFlHWUdZR1lHWUdZR1lHWUdZR1lIWEhYSFlHWUdZR1lHWUdZR1lHWUdZR1lI"
"WEhYSFhIWEhYSFhIWEhYSFhIWElXSVdJV0lXSVdJVkpWSlZLVUtVS1VLVExUTFRMVE1STlJOUU9Q"
"UUtWQ185ayt7GbEs");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 480, 320, 160, 160, 0xff652e89, 16,
+ match = compare_figure(ctx.surface, 480, 320, 160, 160, 0xff652e89, 16,
"pCwYfixuOGNCWUxSUFBQT1JOUk5STlJOUk1UTFRMVExUTFRLVkpWSlZKVkpWSlZJWEhYSFhIWEhY"
"SFhIWEhYSFhIWEdaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpGWkZaRlpG"
"WkdYSFhIWEhYSFhIWEhYSFhIWEhYSVZKVkpWSlZKVkpWS1RMVExUTFRMVE1STlJOUk5STlJPUFBQ"
@@ -7451,19 +7391,19 @@ static void test_fill_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 32,
"6DMNjgEWiAEahgEahgEahgEahgEahgEahgEahgEahgEahgEahgEahwEZhwEZhwEZhwEZhwEZhwEZ"
"hwEZhwEZhwEZiAEYiAEYiAEYiAEYiAEXiQEXiQEXiQEXigEWigEWigEWigEWigEWigEWigEWiwEU"
"jAEUjAEUjAEUjQESjgESjwEQkAEQkQEOkgENlAEMlQEKlgEKlwEImAEImQEHmQEGmwEFmwEEnQED"
"nQECngECngECnwEBnwEBnwEBnwEBnwEBnwECnQEDnQEDnQEEmwEFmgEHmQEHlwELkQERjAEXhgEd"
"hAEfgwEchgEXjwEMqTEA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 32,
"h58BBrYCDq0CF6QCIJwCKJMCMIwCNoUCPf8BQ/kBSPQBTu4BTe8BTPEBSfUBRvgBQf0BPYECOYUC"
"NIoCMI4CK+UBAS0W/AEHIwiPAgsaBZcCEAwIngIepAIaqAIWrAITsAIRsgIPtQIMtwILugIHwAIB"
"ypwB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 32,
"wW4DnAEEmwEFmgEHmAEIlwEKlQELlAEMkwEOkQEPkAEQkAERjgESjgETjAEUjAEUiwEWigEWiQEX"
"iQEYhwEZhwEZhgEbhQEbhAEchAEdggEeggEeggEfgAEggAEggAEhgAEggAEggQEggAEggAEggQEg"
"gAEggQEfgQEfggEfgQEfgQEfggEfgQEfggEeggEfggEeggEegwEdgwEeggEegwEdgwEegwEdgwEd"
@@ -7474,7 +7414,7 @@ static void test_fill_geometry(void)
"AQ6SAQ2TAQ2SAQ2TAQ2TAQyTAQyUAQyUAQuUAQuVAQuUAQuVAQqWAQmWAQqWAQmXAQiXAQiYAQeY"
"AQeZAQWbAQSDZwAA");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 32,
+ match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 32,
"g90BBLkCCLYCC7ICDrACEa0CFKoCF6cCGqQCHKMCHqECIJ8CIpwCJJsCJpkCKJcCKZYCK5QCLZIC"
"L5ACMI8CMo0CNIsCNYoCN4gCOYcCOYYCO4QCPYICPoECQIACQYACQIECQIACQIECQIECQIECP4IC"
"P4ICP4ECP4ICP4ICPoMCPoMCPoMCPYQCPYMCPYQCPYQCPYQCPIUCPIUCPIUCO4YCO4YCOoYCO4YC"
@@ -7555,20 +7495,19 @@ static void test_fill_geometry(void)
ID2D1TransformedGeometry_Release(transformed_geometry[1]);
ID2D1TransformedGeometry_Release(transformed_geometry[0]);
- match = compare_figure(surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
+ match = compare_figure(ctx.surface, 0, 0, 160, 160, 0xff652e89, 0, "gMgB");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 0, 320, 160, 0xff652e89, 0, "gJAD");
+ match = compare_figure(ctx.surface, 160, 0, 320, 160, 0xff652e89, 0, "gJAD");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 0, 160, 160, 320, 0xff652e89, 0, "gJAD");
+ match = compare_figure(ctx.surface, 0, 160, 160, 320, 0xff652e89, 0, "gJAD");
ok(match, "Figure does not match.\n");
- match = compare_figure(surface, 160, 160, 320, 320, 0xff652e89, 0, "gKAG");
+ match = compare_figure(ctx.surface, 160, 160, 320, 320, 0xff652e89, 0, "gKAG");
ok(match, "Figure does not match.\n");
ID2D1SolidColorBrush_Release(brush);
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -7708,7 +7647,6 @@ static void test_layer(void)
ID2D1Factory *factory, *layer_factory;
struct d2d1_test_context ctx;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Layer *layer;
D2D1_SIZE_F size;
ULONG refcount;
@@ -7717,9 +7655,7 @@ static void test_layer(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -7747,7 +7683,6 @@ static void test_layer(void)
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -7759,7 +7694,6 @@ static void test_bezier_intersect(void)
ID2D1PathGeometry *geometry;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F color;
ULONG refcount;
@@ -7769,9 +7703,7 @@ static void test_bezier_intersect(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_GetFactory(rt, &factory);
@@ -7816,7 +7748,7 @@ static void test_bezier_intersect(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 160, 120, 320, 240, 0xff652e89, 2048,
+ match = compare_figure(ctx.surface, 160, 120, 320, 240, 0xff652e89, 2048,
"aRQjIxRpYiIcHCJiXSwXFyxdWTQTEzRZVTsQEDtVUkIMDEJST0cKCkdPTUsICEtNSlEFBVFKSFUD"
"A1VIRlkBAVlGRFsBAVtEQlwCAlxCQFwEBFxAPl0FBV0+PF0HB108Ol4ICF46OV0KCl05N14LC143"
"Nl4MDF42NF8NDV80M14PD14zMV8QEF8xMF8REV8wL18SEl8vLWATE2AtLGAUFGAsK2EUFGErKWIV"
@@ -7866,7 +7798,7 @@ static void test_bezier_intersect(void)
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
ID2D1PathGeometry_Release(geometry);
- match = compare_figure(surface, 160, 120, 320, 240, 0xff652e89, 2048,
+ match = compare_figure(ctx.surface, 160, 120, 320, 240, 0xff652e89, 2048,
"pQIZkgIrhAI5/QE/9gFH7wFO6wFS5wFW4gFb3gFf2wFi2AFl1gFn1AFp0gFszwFuzQFxywFyyQF1"
"xwF2xgF4xAF5xAF6wgF8wAF+vwF+vwF/vQGBAbwBggG7AYMBugGEAbkBhQG4AYYBtwGHAbcBiAG1"
"AYkBtAGKAbQBigGzAYsBswGMAbEBjQGxAY0BsQGOAa8BjwGvAZABrgGQAa4BkQGtAZEBrQGSAawB"
@@ -7889,7 +7821,6 @@ static void test_bezier_intersect(void)
ID2D1RenderTarget_Release(rt);
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
@@ -8164,7 +8095,7 @@ static void test_bitmap_surface(void)
D2D1_RENDER_TARGET_PROPERTIES rt_desc;
D2D1_BITMAP_PROPERTIES1 bitmap_desc;
ID2D1DeviceContext *device_context;
- IDXGISurface *surface, *surface2;
+ IDXGISurface *surface2;
D2D1_PIXEL_FORMAT pixel_format;
struct d2d1_test_context ctx;
IDXGIDevice *dxgi_device;
@@ -8192,9 +8123,7 @@ static void test_bitmap_surface(void)
}
/* DXGI target */
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
@@ -8228,7 +8157,7 @@ static void test_bitmap_surface(void)
bitmap_desc.pixelFormat = bitmap_format_tests[i].original;
bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
- hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, surface, &bitmap_desc, &bitmap);
+ hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, &bitmap_desc, &bitmap);
todo_wine_if(bitmap_format_tests[i].hr == WINCODEC_ERR_UNSUPPORTEDPIXELFORMAT)
ok(hr == bitmap_format_tests[i].hr, "%u: unexpected hr %#x.\n", i, hr);
@@ -8246,7 +8175,7 @@ static void test_bitmap_surface(void)
}
/* A8 surface */
- hr = IDXGISurface_GetDevice(surface, &IID_IDXGIDevice, (void **)&dxgi_device);
+ hr = IDXGISurface_GetDevice(ctx.surface, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get the device, hr %#x.\n", hr);
surface2 = create_surface(dxgi_device, DXGI_FORMAT_A8_UNORM);
@@ -8267,7 +8196,7 @@ static void test_bitmap_surface(void)
IDXGIDevice_Release(dxgi_device);
IDXGISurface_Release(surface2);
- hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, surface, NULL, &bitmap);
+ hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, NULL, &bitmap);
ok(SUCCEEDED(hr), "Failed to create a bitmap, hr %#x.\n", hr);
pixel_format = ID2D1Bitmap1_GetPixelFormat(bitmap);
@@ -8325,7 +8254,6 @@ static void test_bitmap_surface(void)
ID2D1Device_Release(device);
IDXGIDevice_Release(dxgi_device);
- IDXGISurface_Release(surface);
/* DC target */
rt_desc.type = D2D1_RENDER_TARGET_TYPE_DEFAULT;
@@ -8442,9 +8370,7 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
/* DXGI target */
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context);
@@ -8455,13 +8381,13 @@ static void test_device_context(void)
"Unexpected bitmap options %#x.\n", options);
hr = ID2D1Bitmap1_GetSurface(bitmap, &surface2);
ok(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
- ok(surface2 == surface, "Unexpected surface instance.\n");
+ ok(surface2 == ctx.surface, "Unexpected surface instance.\n");
IDXGISurface_Release(surface2);
ID2D1DeviceContext_BeginDraw(device_context);
hr = ID2D1Bitmap1_GetSurface(bitmap, &surface2);
ok(SUCCEEDED(hr), "Failed to get bitmap surface, hr %#x.\n", hr);
- ok(surface2 == surface, "Unexpected surface instance.\n");
+ ok(surface2 == ctx.surface, "Unexpected surface instance.\n");
IDXGISurface_Release(surface2);
ID2D1DeviceContext_EndDraw(device_context, NULL, NULL);
ID2D1Bitmap1_Release(bitmap);
@@ -8472,7 +8398,6 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
/* WIC target */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -9100,7 +9025,6 @@ static void test_dpi(void)
IWICImagingFactory *wic_factory;
struct d2d1_test_context ctx;
ID2D1Factory1 *factory;
- IDXGISurface *surface;
ID2D1Bitmap1 *bitmap;
float dpi_x, dpi_y;
HRESULT hr;
@@ -9135,8 +9059,6 @@ static void test_dpi(void)
return;
}
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
device_context = create_device_context(factory, ctx.device);
ok(!!device_context, "Failed to create device context.\n");
@@ -9156,7 +9078,7 @@ static void test_dpi(void)
bitmap_desc.dpiY = create_dpi_tests[i].dpi_y;
bitmap_desc.bitmapOptions = D2D1_BITMAP_OPTIONS_TARGET | D2D1_BITMAP_OPTIONS_CANNOT_DRAW;
bitmap_desc.colorContext = NULL;
- hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, surface, &bitmap_desc, &bitmap);
+ hr = ID2D1DeviceContext_CreateBitmapFromDxgiSurface(device_context, ctx.surface, &bitmap_desc, &bitmap);
/* Native accepts negative DPI values for DXGI surface bitmap. */
ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr);
@@ -9304,7 +9226,6 @@ static void test_dpi(void)
ok(dpi_y == dc_dpi_y, "Got unexpected dpi_y %.8e, expected %.8e.\n", dpi_y, dc_dpi_y);
ID2D1DeviceContext_Release(device_context);
- IDXGISurface_Release(surface);
ID2D1Factory1_Release(factory);
release_test_context(&ctx);
}
@@ -9316,7 +9237,6 @@ static void test_wic_bitmap_format(void)
D2D1_PIXEL_FORMAT format;
IWICBitmap *wic_bitmap;
ID2D1RenderTarget *rt;
- IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i;
HRESULT hr;
@@ -9336,9 +9256,7 @@ static void test_wic_bitmap_format(void)
if (!init_test_context(&ctx))
return;
- hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
- ok(hr == S_OK, "Failed to get buffer, hr %#x.\n", hr);
- rt = create_render_target(surface);
+ rt = create_render_target(ctx.surface);
ok(!!rt, "Failed to create render target.\n");
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -9368,7 +9286,6 @@ static void test_wic_bitmap_format(void)
IWICImagingFactory_Release(wic_factory);
CoUninitialize();
ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface);
release_test_context(&ctx);
}
--
2.20.1
2
1
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Swapchain creation is not supposed to fail.
dlls/d2d1/tests/d2d1.c | 118 ++++++++++-------------------------------
1 file changed, 28 insertions(+), 90 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index dd537c53e73..545f5dc20a7 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -46,6 +46,7 @@ struct d2d1_test_context
{
ID3D10Device1 *device;
HWND window;
+ IDXGISwapChain *swapchain;
};
struct resource_readback
@@ -788,6 +789,7 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
#define release_test_context(ctx) release_test_context_(__LINE__, ctx)
static void release_test_context_(unsigned int line, struct d2d1_test_context *ctx)
{
+ IDXGISwapChain_Release(ctx->swapchain);
DestroyWindow(ctx->window);
ID3D10Device1_Release(ctx->device);
}
@@ -805,6 +807,8 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
ctx->window = create_window();
ok_(__FILE__, line)(!!ctx->window, "Failed to create test window.\n");
+ ctx->swapchain = create_swapchain(ctx->device, ctx->window, TRUE);
+ ok_(__FILE__, line)(!!ctx->swapchain, "Failed to create swapchain.\n");
return TRUE;
}
@@ -1118,7 +1122,6 @@ static void geometry_sink_check_(unsigned int line, const struct geometry_sink *
static void test_clip(void)
{
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
D2D1_SIZE_U pixel_size;
ID2D1RenderTarget *rt;
@@ -1140,8 +1143,7 @@ static void test_clip(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -1313,7 +1315,6 @@ static void test_clip(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -1324,7 +1325,6 @@ static void test_state_block(void)
ID2D1DrawingStateBlock *state_block;
IDWriteFactory *dwrite_factory;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1Factory1 *factory1;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
@@ -1353,8 +1353,7 @@ static void test_state_block(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -1582,7 +1581,6 @@ static void test_state_block(void)
ID2D1Factory_Release(factory);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -1593,7 +1591,6 @@ static void test_color_brush(void)
D2D1_COLOR_F color, tmp_color;
struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
D2D1_RECT_F rect;
@@ -1604,8 +1601,7 @@ static void test_color_brush(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -1677,7 +1673,6 @@ static void test_color_brush(void)
ID2D1SolidColorBrush_Release(brush);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -1692,7 +1687,6 @@ static void test_bitmap_brush(void)
D2D1_RECT_F src_rect, dst_rect;
struct d2d1_test_context ctx;
D2D1_EXTEND_MODE extend_mode;
- IDXGISwapChain *swapchain;
ID2D1BitmapBrush1 *brush1;
ID2D1BitmapBrush *brush;
D2D1_SIZE_F image_size;
@@ -1739,8 +1733,7 @@ static void test_bitmap_brush(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -2079,7 +2072,6 @@ static void test_bitmap_brush(void)
ok(!refcount, "Bitmap has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -2093,7 +2085,6 @@ static void test_linear_brush(void)
ID2D1LinearGradientBrush *brush;
struct d2d1_test_context ctx;
struct resource_readback rb;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Factory *factory;
@@ -2145,8 +2136,7 @@ static void test_linear_brush(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -2280,7 +2270,6 @@ static void test_linear_brush(void)
ok(!refcount, "Gradient has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -2294,7 +2283,6 @@ static void test_radial_brush(void)
ID2D1RadialGradientBrush *brush;
struct d2d1_test_context ctx;
struct resource_readback rb;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Factory *factory;
@@ -2346,8 +2334,7 @@ static void test_radial_brush(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -2489,7 +2476,6 @@ static void test_radial_brush(void)
ok(!refcount, "Gradient has %u references left.\n", refcount);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -2619,7 +2605,6 @@ static void test_path_geometry(void)
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
ID2D1Geometry *tmp_geometry;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Factory *factory;
@@ -2947,8 +2932,7 @@ static void test_path_geometry(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -3674,7 +3658,6 @@ static void test_path_geometry(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -4009,7 +3992,6 @@ static void test_bitmap_formats(void)
{
D2D1_BITMAP_PROPERTIES bitmap_desc;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
D2D1_SIZE_U size = {4, 4};
ID2D1RenderTarget *rt;
IDXGISurface *surface;
@@ -4043,8 +4025,7 @@ static void test_bitmap_formats(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -4074,7 +4055,6 @@ static void test_bitmap_formats(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -4085,7 +4065,6 @@ static void test_alpha_mode(void)
ID2D1SolidColorBrush *color_brush;
ID2D1BitmapBrush *bitmap_brush;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
@@ -4107,8 +4086,7 @@ static void test_alpha_mode(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -4298,13 +4276,11 @@ static void test_alpha_mode(void)
ID2D1BitmapBrush_Release(bitmap_brush);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
static void test_shared_bitmap(void)
{
- IDXGISwapChain *swapchain1, *swapchain2;
IWICBitmap *wic_bitmap1, *wic_bitmap2;
ID2D1GdiInteropRenderTarget *interop;
D2D1_RENDER_TARGET_PROPERTIES desc;
@@ -4317,6 +4293,7 @@ static void test_shared_bitmap(void)
DXGI_SURFACE_DESC surface_desc;
D2D1_PIXEL_FORMAT pixel_format;
struct d2d1_test_context ctx;
+ IDXGISwapChain *swapchain2;
D2D1_SIZE_U size = {4, 4};
IDXGISurface1 *surface3;
ID3D10Device1 *device2;
@@ -4327,9 +4304,8 @@ static void test_shared_bitmap(void)
return;
window2 = create_window();
- swapchain1 = create_swapchain(ctx.device, ctx.window, TRUE);
swapchain2 = create_swapchain(ctx.device, window2, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain1, 0, &IID_IDXGISurface, (void **)&surface1);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface1);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -4547,7 +4523,6 @@ static void test_shared_bitmap(void)
IDXGISurface_Release(surface2);
IDXGISurface_Release(surface1);
IDXGISwapChain_Release(swapchain2);
- IDXGISwapChain_Release(swapchain1);
ID3D10Device1_Release(device2);
release_test_context(&ctx);
DestroyWindow(window2);
@@ -4558,7 +4533,6 @@ static void test_bitmap_updates(void)
{
D2D1_BITMAP_PROPERTIES bitmap_desc;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
D2D1_RECT_U dst_rect;
@@ -4580,8 +4554,7 @@ static void test_bitmap_updates(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -4648,7 +4621,6 @@ static void test_bitmap_updates(void)
ID2D1Bitmap_Release(bitmap);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -4659,7 +4631,6 @@ static void test_opacity_brush(void)
ID2D1RectangleGeometry *geometry;
ID2D1SolidColorBrush *color_brush;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
@@ -4683,8 +4654,7 @@ static void test_opacity_brush(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -4824,14 +4794,12 @@ static void test_opacity_brush(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
static void test_create_target(void)
{
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1Factory *factory;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
@@ -4856,8 +4824,7 @@ static void test_create_target(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
@@ -4910,7 +4877,6 @@ static void test_create_target(void)
ID2D1Factory_Release(factory);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -4948,7 +4914,6 @@ static void test_draw_text_layout(void)
{ D2D1_TEXT_ANTIALIAS_MODE_ALIASED, DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC, E_INVALIDARG },
};
D2D1_RENDER_TARGET_PROPERTIES desc;
- IDXGISwapChain *swapchain;
ID2D1Factory *factory, *factory2;
ID2D1RenderTarget *rt, *rt2;
IDXGISurface *surface;
@@ -4968,8 +4933,7 @@ static void test_draw_text_layout(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
@@ -5075,7 +5039,6 @@ todo_wine
ID2D1Factory_Release(factory);
ID2D1Factory_Release(factory2);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -5838,7 +5801,6 @@ static void test_gradient(void)
ID2D1GradientStopCollection *gradient;
D2D1_GRADIENT_STOP stops[3], stops2[3];
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
D2D1_COLOR_F color;
@@ -5849,8 +5811,7 @@ static void test_gradient(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -5882,7 +5843,6 @@ static void test_gradient(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -5895,7 +5855,6 @@ static void test_draw_geometry(void)
struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
- IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
@@ -5912,8 +5871,7 @@ static void test_draw_geometry(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -6805,7 +6763,6 @@ static void test_draw_geometry(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -6818,7 +6775,6 @@ static void test_fill_geometry(void)
struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
- IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
@@ -6834,8 +6790,7 @@ static void test_fill_geometry(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -7614,7 +7569,6 @@ static void test_fill_geometry(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -7753,7 +7707,6 @@ static void test_layer(void)
{
ID2D1Factory *factory, *layer_factory;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
ID2D1Layer *layer;
@@ -7764,8 +7717,7 @@ static void test_layer(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -7796,7 +7748,6 @@ static void test_layer(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -7806,7 +7757,6 @@ static void test_bezier_intersect(void)
struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
- IDXGISwapChain *swapchain;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
@@ -7819,8 +7769,7 @@ static void test_bezier_intersect(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -7941,7 +7890,6 @@ static void test_bezier_intersect(void)
refcount = ID2D1Factory_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
@@ -8219,7 +8167,6 @@ static void test_bitmap_surface(void)
IDXGISurface *surface, *surface2;
D2D1_PIXEL_FORMAT pixel_format;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
IDXGIDevice *dxgi_device;
ID2D1Factory1 *factory;
ID2D1RenderTarget *rt;
@@ -8245,8 +8192,7 @@ static void test_bitmap_surface(void)
}
/* DXGI target */
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -8449,7 +8395,6 @@ static void test_device_context(void)
struct d2d1_test_context ctx;
D2D1_BITMAP_OPTIONS options;
ID2D1DCRenderTarget *dc_rt;
- IDXGISwapChain *swapchain;
IDXGIDevice *dxgi_device;
D2D1_UNIT_MODE unit_mode;
ID2D1Factory1 *factory;
@@ -8497,8 +8442,7 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
/* DXGI target */
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -9155,7 +9099,6 @@ static void test_dpi(void)
ID2D1DeviceContext *device_context;
IWICImagingFactory *wic_factory;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
ID2D1Factory1 *factory;
IDXGISurface *surface;
ID2D1Bitmap1 *bitmap;
@@ -9192,8 +9135,7 @@ static void test_dpi(void)
return;
}
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
device_context = create_device_context(factory, ctx.device);
@@ -9363,7 +9305,6 @@ static void test_dpi(void)
ID2D1DeviceContext_Release(device_context);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
ID2D1Factory1_Release(factory);
release_test_context(&ctx);
}
@@ -9372,7 +9313,6 @@ static void test_wic_bitmap_format(void)
{
IWICImagingFactory *wic_factory;
struct d2d1_test_context ctx;
- IDXGISwapChain *swapchain;
D2D1_PIXEL_FORMAT format;
IWICBitmap *wic_bitmap;
ID2D1RenderTarget *rt;
@@ -9396,8 +9336,7 @@ static void test_wic_bitmap_format(void)
if (!init_test_context(&ctx))
return;
- swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
- hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
+ hr = IDXGISwapChain_GetBuffer(ctx.swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
ok(!!rt, "Failed to create render target.\n");
@@ -9430,7 +9369,6 @@ static void test_wic_bitmap_format(void)
CoUninitialize();
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
}
--
2.20.1
2
1
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Window creation is not supposed to fail.
dlls/d2d1/tests/d2d1.c | 120 ++++++++++-------------------------------
1 file changed, 29 insertions(+), 91 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index de3755b9674..dd537c53e73 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -45,6 +45,7 @@ size_t mt_tests_size, mt_test_count;
struct d2d1_test_context
{
ID3D10Device1 *device;
+ HWND window;
};
struct resource_readback
@@ -787,6 +788,7 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
#define release_test_context(ctx) release_test_context_(__LINE__, ctx)
static void release_test_context_(unsigned int line, struct d2d1_test_context *ctx)
{
+ DestroyWindow(ctx->window);
ID3D10Device1_Release(ctx->device);
}
@@ -801,6 +803,9 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
return FALSE;
}
+ ctx->window = create_window();
+ ok_(__FILE__, line)(!!ctx->window, "Failed to create test window.\n");
+
return TRUE;
}
@@ -1123,7 +1128,6 @@ static void test_clip(void)
float dpi_x, dpi_y;
D2D1_RECT_F rect;
D2D1_SIZE_F size;
- HWND window;
HRESULT hr;
BOOL match;
static const D2D1_MATRIX_3X2_F identity =
@@ -1136,8 +1140,7 @@ static void test_clip(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1312,7 +1315,6 @@ static void test_clip(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_state_block(void)
@@ -1328,7 +1330,6 @@ static void test_state_block(void)
IDXGISurface *surface;
ID2D1Factory *factory;
ULONG refcount;
- HWND window;
HRESULT hr;
static const D2D1_MATRIX_3X2_F identity =
{{{
@@ -1352,8 +1353,7 @@ static void test_state_block(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1584,7 +1584,6 @@ static void test_state_block(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_color_brush(void)
@@ -1599,15 +1598,13 @@ static void test_color_brush(void)
IDXGISurface *surface;
D2D1_RECT_F rect;
float opacity;
- HWND window;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1682,7 +1679,6 @@ static void test_color_brush(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_bitmap_brush(void)
@@ -1709,7 +1705,6 @@ static void test_bitmap_brush(void)
unsigned int i;
ULONG refcount;
float opacity;
- HWND window;
HRESULT hr;
BOOL match;
@@ -1744,8 +1739,7 @@ static void test_bitmap_brush(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2087,7 +2081,6 @@ static void test_bitmap_brush(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_linear_brush(void)
@@ -2110,7 +2103,6 @@ static void test_linear_brush(void)
ULONG refcount;
D2D1_RECT_F r;
float opacity;
- HWND window;
HRESULT hr;
static const D2D1_GRADIENT_STOP stops[] =
@@ -2153,8 +2145,7 @@ static void test_linear_brush(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2291,7 +2282,6 @@ static void test_linear_brush(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_radial_brush(void)
@@ -2313,7 +2303,6 @@ static void test_radial_brush(void)
unsigned int i;
ULONG refcount;
D2D1_RECT_F r;
- HWND window;
HRESULT hr;
float f;
@@ -2357,8 +2346,7 @@ static void test_radial_brush(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2503,7 +2491,6 @@ static void test_radial_brush(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void fill_geometry_sink(ID2D1GeometrySink *sink, unsigned int hollow_count)
@@ -2641,7 +2628,6 @@ static void test_path_geometry(void)
D2D1_RECT_F rect;
ULONG refcount;
UINT32 count;
- HWND window;
HRESULT hr;
static const struct geometry_segment expected_segments[] =
@@ -2961,8 +2947,7 @@ static void test_path_geometry(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -3691,7 +3676,6 @@ static void test_path_geometry(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_rectangle_geometry(void)
@@ -4031,7 +4015,6 @@ static void test_bitmap_formats(void)
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i, j;
- HWND window;
HRESULT hr;
static const struct
@@ -4060,8 +4043,7 @@ static void test_bitmap_formats(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4094,7 +4076,6 @@ static void test_bitmap_formats(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_alpha_mode(void)
@@ -4112,7 +4093,6 @@ static void test_alpha_mode(void)
D2D1_RECT_F rect;
D2D1_SIZE_U size;
ULONG refcount;
- HWND window;
HRESULT hr;
BOOL match;
@@ -4127,8 +4107,7 @@ static void test_alpha_mode(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4321,7 +4300,6 @@ static void test_alpha_mode(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_shared_bitmap(void)
@@ -4342,15 +4320,14 @@ static void test_shared_bitmap(void)
D2D1_SIZE_U size = {4, 4};
IDXGISurface1 *surface3;
ID3D10Device1 *device2;
- HWND window1, window2;
+ HWND window2;
HRESULT hr;
if (!init_test_context(&ctx))
return;
- window1 = create_window();
window2 = create_window();
- swapchain1 = create_swapchain(ctx.device, window1, TRUE);
+ swapchain1 = create_swapchain(ctx.device, ctx.window, TRUE);
swapchain2 = create_swapchain(ctx.device, window2, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain1, 0, &IID_IDXGISurface, (void **)&surface1);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -4574,7 +4551,6 @@ static void test_shared_bitmap(void)
ID3D10Device1_Release(device2);
release_test_context(&ctx);
DestroyWindow(window2);
- DestroyWindow(window1);
CoUninitialize();
}
@@ -4590,7 +4566,6 @@ static void test_bitmap_updates(void)
D2D1_COLOR_F color;
D2D1_RECT_F rect;
D2D1_SIZE_U size;
- HWND window;
HRESULT hr;
BOOL match;
@@ -4605,8 +4580,7 @@ static void test_bitmap_updates(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4676,7 +4650,6 @@ static void test_bitmap_updates(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_opacity_brush(void)
@@ -4696,7 +4669,6 @@ static void test_opacity_brush(void)
D2D1_RECT_F rect;
D2D1_SIZE_U size;
ULONG refcount;
- HWND window;
HRESULT hr;
BOOL match;
@@ -4711,8 +4683,7 @@ static void test_opacity_brush(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4855,7 +4826,6 @@ static void test_opacity_brush(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_create_target(void)
@@ -4865,7 +4835,6 @@ static void test_create_target(void)
ID2D1Factory *factory;
ID2D1RenderTarget *rt;
IDXGISurface *surface;
- HWND window;
HRESULT hr;
static const struct
{
@@ -4887,8 +4856,7 @@ static void test_create_target(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -4944,7 +4912,6 @@ static void test_create_target(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_draw_text_layout(void)
@@ -4985,7 +4952,6 @@ static void test_draw_text_layout(void)
ID2D1Factory *factory, *factory2;
ID2D1RenderTarget *rt, *rt2;
IDXGISurface *surface;
- HWND window;
HRESULT hr;
IDWriteFactory *dwrite_factory;
IDWriteTextFormat *text_format;
@@ -5002,8 +4968,7 @@ static void test_draw_text_layout(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -5112,7 +5077,6 @@ todo_wine
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void create_target_dibsection(HDC hdc, UINT32 width, UINT32 height)
@@ -5880,14 +5844,12 @@ static void test_gradient(void)
D2D1_COLOR_F color;
unsigned int i;
UINT32 count;
- HWND window;
HRESULT hr;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -5922,7 +5884,6 @@ static void test_gradient(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_draw_geometry(void)
@@ -5945,15 +5906,13 @@ static void test_draw_geometry(void)
D2D1_COLOR_F color;
D2D1_RECT_F rect;
ULONG refcount;
- HWND window;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -6848,7 +6807,6 @@ static void test_draw_geometry(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_fill_geometry(void)
@@ -6870,15 +6828,13 @@ static void test_fill_geometry(void)
D2D1_COLOR_F color;
D2D1_RECT_F rect;
ULONG refcount;
- HWND window;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -7660,7 +7616,6 @@ static void test_fill_geometry(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_gdi_interop(void)
@@ -7804,14 +7759,12 @@ static void test_layer(void)
ID2D1Layer *layer;
D2D1_SIZE_F size;
ULONG refcount;
- HWND window;
HRESULT hr;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -7845,7 +7798,6 @@ static void test_layer(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_bezier_intersect(void)
@@ -7861,15 +7813,13 @@ static void test_bezier_intersect(void)
ID2D1Factory *factory;
D2D1_COLOR_F color;
ULONG refcount;
- HWND window;
HRESULT hr;
BOOL match;
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -7993,7 +7943,6 @@ static void test_bezier_intersect(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_create_device(void)
@@ -8280,7 +8229,6 @@ static void test_bitmap_surface(void)
D2D1_SIZE_U size;
D2D1_TAG t1, t2;
unsigned int i;
- HWND window;
HRESULT hr;
IWICBitmap *wic_bitmap;
@@ -8297,8 +8245,7 @@ static void test_bitmap_surface(void)
}
/* DXGI target */
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -8509,7 +8456,6 @@ static void test_device_context(void)
ID2D1RenderTarget *rt;
ID2D1Bitmap1 *bitmap;
ID2D1Image *target;
- HWND window;
HRESULT hr;
RECT rect;
HDC hdc;
@@ -8551,8 +8497,7 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
/* DXGI target */
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -8584,7 +8529,6 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context);
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
- DestroyWindow(window);
/* WIC target */
CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
@@ -9216,7 +9160,6 @@ static void test_dpi(void)
IDXGISurface *surface;
ID2D1Bitmap1 *bitmap;
float dpi_x, dpi_y;
- HWND window;
HRESULT hr;
static const struct
@@ -9249,8 +9192,7 @@ static void test_dpi(void)
return;
}
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
@@ -9424,7 +9366,6 @@ static void test_dpi(void)
IDXGISwapChain_Release(swapchain);
ID2D1Factory1_Release(factory);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_wic_bitmap_format(void)
@@ -9438,7 +9379,6 @@ static void test_wic_bitmap_format(void)
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i;
- HWND window;
HRESULT hr;
static const struct
@@ -9456,8 +9396,7 @@ static void test_wic_bitmap_format(void)
if (!init_test_context(&ctx))
return;
- window = create_window();
- swapchain = create_swapchain(ctx.device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, ctx.window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -9493,7 +9432,6 @@ static void test_wic_bitmap_format(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
release_test_context(&ctx);
- DestroyWindow(window);
}
static void test_math(void)
--
2.20.1
2
1
From: Rémi Bernon <rbernon(a)codeweavers.com>
Analogous to the d3d11 tests.
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Add line information to the skip in init_test_context_().
dlls/d2d1/tests/d2d1.c | 374 ++++++++++++++++++-----------------------
1 file changed, 167 insertions(+), 207 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 37cdda0aae6..de3755b9674 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -42,6 +42,11 @@ static struct test_entry
} *mt_tests;
size_t mt_tests_size, mt_test_count;
+struct d2d1_test_context
+{
+ ID3D10Device1 *device;
+};
+
struct resource_readback
{
ID3D10Resource *resource;
@@ -779,6 +784,26 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface)
return create_render_target_desc(surface, &desc);
}
+#define release_test_context(ctx) release_test_context_(__LINE__, ctx)
+static void release_test_context_(unsigned int line, struct d2d1_test_context *ctx)
+{
+ ID3D10Device1_Release(ctx->device);
+}
+
+#define init_test_context(ctx) init_test_context_(__LINE__, ctx)
+static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx)
+{
+ memset(ctx, 0, sizeof(*ctx));
+
+ if (!(ctx->device = create_device()))
+ {
+ skip_(__FILE__, line)("Failed to create device, skipping tests.\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
#define check_bitmap_surface(b, s, o) check_bitmap_surface_(__LINE__, b, s, o)
static void check_bitmap_surface_(unsigned int line, ID2D1Bitmap *bitmap, BOOL has_surface, DWORD expected_options)
{
@@ -1087,11 +1112,11 @@ static void geometry_sink_check_(unsigned int line, const struct geometry_sink *
static void test_clip(void)
{
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
D2D1_SIZE_U pixel_size;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
D2D1_POINT_2F point;
D2D1_COLOR_F color;
@@ -1108,13 +1133,11 @@ static void test_clip(void)
0.0f, 0.0f,
}}};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1288,7 +1311,7 @@ static void test_clip(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -1298,10 +1321,10 @@ static void test_state_block(void)
D2D1_DRAWING_STATE_DESCRIPTION drawing_state;
ID2D1DrawingStateBlock *state_block;
IDWriteFactory *dwrite_factory;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1Factory1 *factory1;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
ULONG refcount;
@@ -1326,13 +1349,11 @@ static void test_state_block(void)
11.0f, 12.0f,
}}};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1562,7 +1583,7 @@ static void test_state_block(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -1571,10 +1592,10 @@ static void test_color_brush(void)
D2D1_MATRIX_3X2_F matrix, tmp_matrix;
D2D1_BRUSH_PROPERTIES brush_desc;
D2D1_COLOR_F color, tmp_color;
+ struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
D2D1_RECT_F rect;
float opacity;
@@ -1582,13 +1603,11 @@ static void test_color_brush(void)
HRESULT hr;
BOOL match;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -1662,7 +1681,7 @@ static void test_color_brush(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -1675,13 +1694,13 @@ static void test_bitmap_brush(void)
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1Bitmap *bitmap, *tmp_bitmap;
D2D1_RECT_F src_rect, dst_rect;
+ struct d2d1_test_context ctx;
D2D1_EXTEND_MODE extend_mode;
IDXGISwapChain *swapchain;
ID2D1BitmapBrush1 *brush1;
ID2D1BitmapBrush *brush;
D2D1_SIZE_F image_size;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F color;
@@ -1722,13 +1741,11 @@ static void test_bitmap_brush(void)
0xffffffff, 0xff000000, 0xff000000, 0xff000000,
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2069,7 +2086,7 @@ static void test_bitmap_brush(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -2081,10 +2098,10 @@ static void test_linear_brush(void)
ID2D1RectangleGeometry *rectangle_geometry;
D2D1_MATRIX_3X2_F matrix, tmp_matrix;
ID2D1LinearGradientBrush *brush;
+ struct d2d1_test_context ctx;
struct resource_readback rb;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F colour;
@@ -2133,13 +2150,11 @@ static void test_linear_brush(void)
{520, 390, 0xff90ae40},
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2275,7 +2290,7 @@ static void test_linear_brush(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -2287,10 +2302,10 @@ static void test_radial_brush(void)
ID2D1RectangleGeometry *rectangle_geometry;
D2D1_MATRIX_3X2_F matrix, tmp_matrix;
ID2D1RadialGradientBrush *brush;
+ struct d2d1_test_context ctx;
struct resource_readback rb;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F colour;
@@ -2339,13 +2354,11 @@ static void test_radial_brush(void)
{520, 390, 0xff4059e6},
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -2489,7 +2502,7 @@ static void test_radial_brush(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -2615,12 +2628,12 @@ static void test_path_geometry(void)
ID2D1GeometrySink *sink, *tmp_sink;
struct geometry_sink simplify_sink;
D2D1_POINT_2F point = {0.0f, 0.0f};
+ struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
ID2D1Geometry *tmp_geometry;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
BOOL match, contains;
@@ -2945,13 +2958,11 @@ static void test_path_geometry(void)
{D2D1_FIGURE_BEGIN_HOLLOW, D2D1_FIGURE_END_OPEN, { 40.0f, 20.0f}, 2, &expected_segments[172]},
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -3679,7 +3690,7 @@ static void test_path_geometry(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -4013,10 +4024,10 @@ static void test_rounded_rectangle_geometry(void)
static void test_bitmap_formats(void)
{
D2D1_BITMAP_PROPERTIES bitmap_desc;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
D2D1_SIZE_U size = {4, 4};
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i, j;
@@ -4046,13 +4057,11 @@ static void test_bitmap_formats(void)
{DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, 0x8a},
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4084,7 +4093,7 @@ static void test_bitmap_formats(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -4094,9 +4103,9 @@ static void test_alpha_mode(void)
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1SolidColorBrush *color_brush;
ID2D1BitmapBrush *bitmap_brush;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
D2D1_COLOR_F color;
@@ -4115,13 +4124,11 @@ static void test_alpha_mode(void)
0x7f7f7f7f, 0x7f000000, 0x7f000000, 0x7f000000,
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4313,7 +4320,7 @@ static void test_alpha_mode(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -4327,26 +4334,24 @@ static void test_shared_bitmap(void)
ID2D1RenderTarget *rt1, *rt2, *rt3;
IDXGISurface *surface1, *surface2;
ID2D1Factory *factory1, *factory2;
- ID3D10Device1 *device1, *device2;
IWICImagingFactory *wic_factory;
ID2D1Bitmap *bitmap1, *bitmap2;
DXGI_SURFACE_DESC surface_desc;
D2D1_PIXEL_FORMAT pixel_format;
+ struct d2d1_test_context ctx;
D2D1_SIZE_U size = {4, 4};
IDXGISurface1 *surface3;
+ ID3D10Device1 *device2;
HWND window1, window2;
HRESULT hr;
- if (!(device1 = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
window1 = create_window();
window2 = create_window();
- swapchain1 = create_swapchain(device1, window1, TRUE);
- swapchain2 = create_swapchain(device1, window2, TRUE);
+ swapchain1 = create_swapchain(ctx.device, window1, TRUE);
+ swapchain2 = create_swapchain(ctx.device, window2, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain1, 0, &IID_IDXGISurface, (void **)&surface1);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2);
@@ -4567,7 +4572,7 @@ static void test_shared_bitmap(void)
IDXGISwapChain_Release(swapchain2);
IDXGISwapChain_Release(swapchain1);
ID3D10Device1_Release(device2);
- ID3D10Device1_Release(device1);
+ release_test_context(&ctx);
DestroyWindow(window2);
DestroyWindow(window1);
CoUninitialize();
@@ -4576,9 +4581,9 @@ static void test_shared_bitmap(void)
static void test_bitmap_updates(void)
{
D2D1_BITMAP_PROPERTIES bitmap_desc;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
D2D1_RECT_U dst_rect;
ID2D1Bitmap *bitmap;
@@ -4597,13 +4602,11 @@ static void test_bitmap_updates(void)
0xffffffff, 0xff000000, 0xff000000, 0xff000000,
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4672,7 +4675,7 @@ static void test_bitmap_updates(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -4682,10 +4685,10 @@ static void test_opacity_brush(void)
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1RectangleGeometry *geometry;
ID2D1SolidColorBrush *color_brush;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
ID2D1Bitmap *bitmap;
@@ -4705,13 +4708,11 @@ static void test_opacity_brush(void)
0xffffffff, 0x40000000, 0x40000000, 0xff000000,
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -4853,16 +4854,16 @@ static void test_opacity_brush(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
static void test_create_target(void)
{
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1Factory *factory;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
HWND window;
HRESULT hr;
@@ -4883,13 +4884,11 @@ static void test_create_target(void)
};
unsigned int i;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -4944,7 +4943,7 @@ static void test_create_target(void)
ID2D1Factory_Release(factory);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -4985,13 +4984,13 @@ static void test_draw_text_layout(void)
IDXGISwapChain *swapchain;
ID2D1Factory *factory, *factory2;
ID2D1RenderTarget *rt, *rt2;
- ID3D10Device1 *device;
IDXGISurface *surface;
HWND window;
HRESULT hr;
IDWriteFactory *dwrite_factory;
IDWriteTextFormat *text_format;
IDWriteTextLayout *text_layout;
+ struct d2d1_test_context ctx;
D2D1_POINT_2F origin;
DWRITE_TEXT_RANGE range;
D2D1_COLOR_F color;
@@ -5000,13 +4999,11 @@ static void test_draw_text_layout(void)
D2D1_RECT_F rect;
unsigned int i;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
@@ -5114,7 +5111,7 @@ todo_wine
ID2D1Factory_Release(factory2);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -5151,11 +5148,11 @@ static void test_dc_target(void)
D2D1_RENDER_TARGET_PROPERTIES desc;
D2D1_MATRIX_3X2_F matrix, matrix2;
ID2D1DCRenderTarget *rt, *rt2;
+ struct d2d1_test_context ctx;
D2D1_ANTIALIAS_MODE aa_mode;
ID2D1SolidColorBrush *brush;
ID2D1RenderTarget *rt3;
ID2D1Factory *factory;
- ID3D10Device1 *device;
FLOAT dpi_x, dpi_y;
D2D1_COLOR_F color;
D2D1_SIZE_U sizeu;
@@ -5168,12 +5165,9 @@ static void test_dc_target(void)
HRESULT hr;
RECT rect;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -5375,18 +5369,15 @@ static void test_hwnd_target(void)
ID2D1GdiInteropRenderTarget *interop;
D2D1_RENDER_TARGET_PROPERTIES desc;
ID2D1HwndRenderTarget *rt, *rt2;
+ struct d2d1_test_context ctx;
ID2D1RenderTarget *rt3;
ID2D1Factory *factory;
- ID3D10Device1 *device;
D2D1_SIZE_U size;
HRESULT hr;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -5541,22 +5532,19 @@ static void test_bitmap_target(void)
ID2D1BitmapRenderTarget *rt, *rt2;
ID2D1HwndRenderTarget *hwnd_rt;
ID2D1Bitmap *bitmap, *bitmap2;
+ struct d2d1_test_context ctx;
ID2D1DCRenderTarget *dc_rt;
D2D1_SIZE_F size, size2;
ID2D1RenderTarget *rt3;
ID2D1Factory *factory;
- ID3D10Device1 *device;
float dpi[2], dpi2[2];
D2D1_COLOR_F color;
ULONG refcount;
HRESULT hr;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -5885,9 +5873,9 @@ static void test_gradient(void)
{
ID2D1GradientStopCollection *gradient;
D2D1_GRADIENT_STOP stops[3], stops2[3];
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
D2D1_COLOR_F color;
unsigned int i;
@@ -5895,13 +5883,11 @@ static void test_gradient(void)
HWND window;
HRESULT hr;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -5935,7 +5921,7 @@ static void test_gradient(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -5945,13 +5931,13 @@ static void test_draw_geometry(void)
ID2D1RectangleGeometry *rect_geometry[2];
D2D1_POINT_2F point = {0.0f, 0.0f};
D2D1_ROUNDED_RECT rounded_rect;
+ struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_POINT_2F p0, p1;
@@ -5963,13 +5949,11 @@ static void test_draw_geometry(void)
HRESULT hr;
BOOL match;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -6863,7 +6847,7 @@ static void test_draw_geometry(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -6873,13 +6857,13 @@ static void test_fill_geometry(void)
ID2D1RectangleGeometry *rect_geometry[2];
D2D1_POINT_2F point = {0.0f, 0.0f};
D2D1_ROUNDED_RECT rounded_rect;
+ struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
IDXGISwapChain *swapchain;
D2D1_MATRIX_3X2_F matrix;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_ELLIPSE ellipse;
@@ -6890,13 +6874,11 @@ static void test_fill_geometry(void)
HRESULT hr;
BOOL match;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -7677,7 +7659,7 @@ static void test_fill_geometry(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
@@ -7686,22 +7668,19 @@ static void test_gdi_interop(void)
ID2D1GdiInteropRenderTarget *interop;
D2D1_RENDER_TARGET_PROPERTIES desc;
IWICImagingFactory *wic_factory;
+ struct d2d1_test_context ctx;
IWICBitmapLock *wic_lock;
IWICBitmap *wic_bitmap;
ID2D1RenderTarget *rt;
ID2D1Factory *factory;
- ID3D10Device1 *device;
D2D1_COLOR_F color;
HRESULT hr;
BOOL match;
RECT rect;
HDC dc;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory);
ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr);
@@ -7812,14 +7791,15 @@ todo_wine
IWICBitmap_Release(wic_bitmap);
ID2D1Factory_Release(factory);
+ release_test_context(&ctx);
}
static void test_layer(void)
{
ID2D1Factory *factory, *layer_factory;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Layer *layer;
D2D1_SIZE_F size;
@@ -7827,13 +7807,11 @@ static void test_layer(void)
HWND window;
HRESULT hr;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -7866,19 +7844,19 @@ static void test_layer(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
static void test_bezier_intersect(void)
{
D2D1_POINT_2F point = {0.0f, 0.0f};
+ struct d2d1_test_context ctx;
ID2D1SolidColorBrush *brush;
ID2D1PathGeometry *geometry;
IDXGISwapChain *swapchain;
ID2D1GeometrySink *sink;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Factory *factory;
D2D1_COLOR_F color;
@@ -7887,13 +7865,11 @@ static void test_bezier_intersect(void)
HRESULT hr;
BOOL match;
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -8016,14 +7992,14 @@ static void test_bezier_intersect(void)
ok(!refcount, "Factory has %u references left.\n", refcount);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
static void test_create_device(void)
{
D2D1_CREATION_PROPERTIES properties = {0};
- ID3D10Device1 *d3d_device;
+ struct d2d1_test_context ctx;
IDXGIDevice *dxgi_device;
ID2D1Factory1 *factory;
ID2D1Factory *factory2;
@@ -8031,20 +8007,17 @@ static void test_create_device(void)
ULONG refcount;
HRESULT hr;
- if (!(d3d_device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory)))
{
win_skip("ID2D1Factory1 is not supported.\n");
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
return;
}
- hr = ID3D10Device1_QueryInterface(d3d_device, &IID_IDXGIDevice, (void **)&dxgi_device);
+ hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
@@ -8069,7 +8042,7 @@ static void test_create_device(void)
win_skip("D2D1CreateDevice() is unavailable.\n");
IDXGIDevice_Release(dxgi_device);
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
refcount = ID2D1Factory1_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
@@ -8296,7 +8269,7 @@ static void test_bitmap_surface(void)
ID2D1DeviceContext *device_context;
IDXGISurface *surface, *surface2;
D2D1_PIXEL_FORMAT pixel_format;
- ID3D10Device1 *d3d_device;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
IDXGIDevice *dxgi_device;
ID2D1Factory1 *factory;
@@ -8313,22 +8286,19 @@ static void test_bitmap_surface(void)
IWICBitmap *wic_bitmap;
IWICImagingFactory *wic_factory;
- if (!(d3d_device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory)))
{
win_skip("ID2D1Factory1 is not supported.\n");
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
return;
}
/* DXGI target */
window = create_window();
- swapchain = create_swapchain(d3d_device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -8350,7 +8320,7 @@ static void test_bitmap_surface(void)
ID2D1RenderTarget_Release(rt);
/* Bitmap created from DXGI surface. */
- hr = ID3D10Device1_QueryInterface(d3d_device, &IID_IDXGIDevice, (void **)&dxgi_device);
+ hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
@@ -8519,7 +8489,7 @@ static void test_bitmap_surface(void)
CoUninitialize();
ID2D1Factory1_Release(factory);
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
}
static void test_device_context(void)
@@ -8529,9 +8499,9 @@ static void test_device_context(void)
ID2D1DeviceContext *device_context;
IDXGISurface *surface, *surface2;
ID2D1Device *device, *device2;
+ struct d2d1_test_context ctx;
D2D1_BITMAP_OPTIONS options;
ID2D1DCRenderTarget *dc_rt;
- ID3D10Device1 *d3d_device;
IDXGISwapChain *swapchain;
IDXGIDevice *dxgi_device;
D2D1_UNIT_MODE unit_mode;
@@ -8547,20 +8517,17 @@ static void test_device_context(void)
IWICBitmap *wic_bitmap;
IWICImagingFactory *wic_factory;
- if (!(d3d_device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory)))
{
win_skip("ID2D1Factory1 is not supported.\n");
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
return;
}
- hr = ID3D10Device1_QueryInterface(d3d_device, &IID_IDXGIDevice, (void **)&dxgi_device);
+ hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device);
ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device);
@@ -8585,7 +8552,7 @@ static void test_device_context(void)
/* DXGI target */
window = create_window();
- swapchain = create_swapchain(d3d_device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -8725,7 +8692,7 @@ todo_wine
ID2D1Device_Release(device);
ID2D1Factory1_Release(factory);
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
}
static void test_invert_matrix(void)
@@ -8890,7 +8857,7 @@ static void test_command_list(void)
D2D1_BITMAP_PROPERTIES bitmap_desc;
ID2D1StrokeStyle *stroke_style;
ID2D1CommandList *command_list;
- ID3D10Device1 *d3d_device;
+ struct d2d1_test_context ctx;
ID2D1Geometry *geometry;
ID2D1Factory1 *factory;
ID2D1RenderTarget *rt;
@@ -8904,20 +8871,17 @@ static void test_command_list(void)
ULONG refcount;
HRESULT hr;
- if (!(d3d_device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory)))
{
win_skip("ID2D1Factory1 is not supported.\n");
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
return;
}
- device_context = create_device_context(factory, d3d_device);
+ device_context = create_device_context(factory, ctx.device);
ok(device_context != NULL, "Failed to create device context.\n");
hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list);
@@ -9103,7 +9067,7 @@ todo_wine
ID2D1CommandList_Release(command_list);
/* List created with different context. */
- device_context2 = create_device_context(factory, d3d_device);
+ device_context2 = create_device_context(factory, ctx.device);
ok(device_context2 != NULL, "Failed to create device context.\n");
hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list);
@@ -9120,6 +9084,7 @@ todo_wine
ID2D1DeviceContext_Release(device_context);
refcount = ID2D1Factory1_Release(factory);
ok(!refcount, "Factory has %u references left.\n", refcount);
+ release_test_context(&ctx);
}
static void test_max_bitmap_size(void)
@@ -9245,8 +9210,8 @@ static void test_dpi(void)
D2D1_BITMAP_PROPERTIES1 bitmap_desc;
ID2D1DeviceContext *device_context;
IWICImagingFactory *wic_factory;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
- ID3D10Device1 *d3d_device;
ID2D1Factory1 *factory;
IDXGISurface *surface;
ID2D1Bitmap1 *bitmap;
@@ -9274,25 +9239,22 @@ static void test_dpi(void)
static const float dc_dpi_x = 120.0f, dc_dpi_y = 144.0f;
unsigned int i;
- if (!(d3d_device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory)))
{
win_skip("ID2D1Factory1 is not supported.\n");
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
return;
}
window = create_window();
- swapchain = create_swapchain(d3d_device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Got unexpected hr %#x.\n", hr);
- device_context = create_device_context(factory, d3d_device);
+ device_context = create_device_context(factory, ctx.device);
ok(!!device_context, "Failed to create device context.\n");
ID2D1DeviceContext_GetDpi(device_context, &dpi_x, &dpi_y);
@@ -9461,18 +9423,18 @@ static void test_dpi(void)
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
ID2D1Factory1_Release(factory);
- ID3D10Device1_Release(d3d_device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
static void test_wic_bitmap_format(void)
{
IWICImagingFactory *wic_factory;
+ struct d2d1_test_context ctx;
IDXGISwapChain *swapchain;
D2D1_PIXEL_FORMAT format;
IWICBitmap *wic_bitmap;
ID2D1RenderTarget *rt;
- ID3D10Device1 *device;
IDXGISurface *surface;
ID2D1Bitmap *bitmap;
unsigned int i;
@@ -9491,13 +9453,11 @@ static void test_wic_bitmap_format(void)
{&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}},
};
- if (!(device = create_device()))
- {
- skip("Failed to create device, skipping tests.\n");
+ if (!init_test_context(&ctx))
return;
- }
+
window = create_window();
- swapchain = create_swapchain(device, window, TRUE);
+ swapchain = create_swapchain(ctx.device, window, TRUE);
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
ok(hr == S_OK, "Failed to get buffer, hr %#x.\n", hr);
rt = create_render_target(surface);
@@ -9532,7 +9492,7 @@ static void test_wic_bitmap_format(void)
ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface);
IDXGISwapChain_Release(swapchain);
- ID3D10Device1_Release(device);
+ release_test_context(&ctx);
DestroyWindow(window);
}
--
2.20.1
2
1
15 Jan '21
From: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Rémi Bernon <rbernon(a)codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com>
---
v3:
- Use win_skip instead of skip, we always expect these to be available on
Wine.
- Rebased the series on top of Jactry's patches.
dlls/d2d1/tests/d2d1.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index 8627f5ebef6..37cdda0aae6 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -30,6 +30,9 @@
static HRESULT (WINAPI *pD2D1CreateDevice)(IDXGIDevice *dxgi_device,
const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device);
+static void (WINAPI *pD2D1SinCos)(float angle, float *s, float *c);
+static float (WINAPI *pD2D1Tan)(float angle);
+static float (WINAPI *pD2D1Vec3Length)(float x, float y, float z);
static BOOL use_mt = TRUE;
@@ -9585,9 +9588,15 @@ static void test_math(void)
{1.0f, 2.0f, 3.0f, 3.74165750f},
};
+ if (!pD2D1SinCos || !pD2D1Tan || !pD2D1Vec3Length)
+ {
+ win_skip("D2D1SinCos/D2D1Tan/D2D1Vec3Length not available, skipping test.\n");
+ return;
+ }
+
for (i = 0; i < ARRAY_SIZE(sc_data); ++i)
{
- D2D1SinCos(sc_data[i].x, &s, &c);
+ pD2D1SinCos(sc_data[i].x, &s, &c);
ok(compare_float(s, sc_data[i].s, 0),
"Test %u: Got unexpected sin %.8e, expected %.8e.\n", i, s, sc_data[i].s);
ok(compare_float(c, sc_data[i].c, 0),
@@ -9596,14 +9605,14 @@ static void test_math(void)
for (i = 0; i < ARRAY_SIZE(t_data); ++i)
{
- t = D2D1Tan(t_data[i].x);
+ t = pD2D1Tan(t_data[i].x);
ok(compare_float(t, t_data[i].t, 1),
"Test %u: Got unexpected tan %.8e, expected %.8e.\n", i, t, t_data[i].t);
}
for (i = 0; i < ARRAY_SIZE(l_data); ++i)
{
- l = D2D1Vec3Length(l_data[i].x, l_data[i].y, l_data[i].z);
+ l = pD2D1Vec3Length(l_data[i].x, l_data[i].y, l_data[i].z);
ok(compare_float(l, l_data[i].l, 0),
"Test %u: Got unexpected length %.8e, expected %.8e.\n", i, l, l_data[i].l);
}
@@ -9611,10 +9620,14 @@ static void test_math(void)
START_TEST(d2d1)
{
+ HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll");
unsigned int argc, i;
char **argv;
- pD2D1CreateDevice = (void *)GetProcAddress(GetModuleHandleA("d2d1.dll"), "D2D1CreateDevice");
+ pD2D1CreateDevice = (void *)GetProcAddress(d2d1_dll, "D2D1CreateDevice");
+ pD2D1SinCos = (void *)GetProcAddress(d2d1_dll, "D2D1SinCos");
+ pD2D1Tan = (void *)GetProcAddress(d2d1_dll, "D2D1Tan");
+ pD2D1Vec3Length = (void *)GetProcAddress(d2d1_dll, "D2D1Vec3Length");
use_mt = !getenv("WINETEST_NO_MT_D3D");
--
2.20.1
1
0
[PATCH 1/3] d2d1: Limit source rectangle to the actual size for ID2D1RenderTarget_DrawBitmap().
by Jactry Zeng 15 Jan '21
by Jactry Zeng 15 Jan '21
15 Jan '21
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
dlls/d2d1/device.c | 18 ++++++------------
dlls/d2d1/tests/d2d1.c | 30 ++++++++++++++++++++++++++++--
2 files changed, 34 insertions(+), 14 deletions(-)
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
index 3c8431ce8f4..b609a2c1e24 100644
--- a/dlls/d2d1/device.c
+++ b/dlls/d2d1/device.c
@@ -1072,25 +1072,19 @@ static void d2d_device_context_draw_bitmap(struct d2d_device_context *context, I
D2D1_BITMAP_BRUSH_PROPERTIES1 bitmap_brush_desc;
D2D1_BRUSH_PROPERTIES brush_desc;
struct d2d_brush *brush;
+ D2D1_SIZE_F size;
D2D1_RECT_F s, d;
HRESULT hr;
if (perspective_transform)
FIXME("Perspective transform is ignored.\n");
- if (src_rect)
+ size = ID2D1Bitmap_GetSize(bitmap);
+ d2d_rect_set(&s, 0.0f, 0.0f, size.width, size.height);
+ if (src_rect && src_rect->left <= src_rect->right
+ && src_rect->top <= src_rect->bottom)
{
- s = *src_rect;
- }
- else
- {
- D2D1_SIZE_F size;
-
- size = ID2D1Bitmap_GetSize(bitmap);
- s.left = 0.0f;
- s.top = 0.0f;
- s.right = size.width;
- s.bottom = size.height;
+ d2d_rect_intersect(&s, src_rect);
}
if (dst_rect)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c
index d571cfe8d15..6e3bc4a51d2 100644
--- a/dlls/d2d1/tests/d2d1.c
+++ b/dlls/d2d1/tests/d2d1.c
@@ -1676,6 +1676,7 @@ static void test_bitmap_brush(void)
IDXGISwapChain *swapchain;
ID2D1BitmapBrush1 *brush1;
ID2D1BitmapBrush *brush;
+ D2D1_SIZE_F image_size;
ID2D1RenderTarget *rt;
ID3D10Device1 *device;
IDXGISurface *surface;
@@ -1740,6 +1741,7 @@ static void test_bitmap_brush(void)
bitmap_desc.dpiY = 96.0f;
hr = ID2D1RenderTarget_CreateBitmap(rt, size, bitmap_data, 4 * sizeof(*bitmap_data), &bitmap_desc, &bitmap);
ok(SUCCEEDED(hr), "Failed to create bitmap, hr %#x.\n", hr);
+ image_size = ID2D1Bitmap_GetSize(bitmap);
hr = ID2D1Bitmap_QueryInterface(bitmap, &IID_ID2D1Image, (void **)&image);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Vista */, "Failed to get ID2D1Image, hr %#x.\n", hr);
@@ -1810,12 +1812,24 @@ static void test_bitmap_brush(void)
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, NULL);
set_rect(&dst_rect, 0.0f, 8.0f, 4.0f, 12.0f);
set_rect(&src_rect, 2.0f, 1.0f, 4.0f, 3.0f);
+ ID2D1RenderTarget_DrawBitmap(rt, bitmap, &dst_rect, 1.0f,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
+ set_rect(&dst_rect, 4.0f, 12.0f, 12.0f, 20.0f);
+ set_rect(&src_rect, 0.0f, 0.0f, image_size.width * 2, image_size.height * 2);
+ ID2D1RenderTarget_DrawBitmap(rt, bitmap, &dst_rect, 1.0f,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
+ set_rect(&dst_rect, 4.0f, 8.0f, 12.0f, 12.0f);
+ set_rect(&src_rect, image_size.width / 2, image_size.height / 2, image_size.width, image_size.height);
+ ID2D1RenderTarget_DrawBitmap(rt, bitmap, &dst_rect, 1.0f,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
+ set_rect(&dst_rect, 0.0f, 4.0f, 4.0f, 8.0f);
+ set_rect(&src_rect, image_size.width, 0.0f, 0.0f, image_size.height);
ID2D1RenderTarget_DrawBitmap(rt, bitmap, &dst_rect, 1.0f,
D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
- match = compare_surface(surface, "9437f4447d98feaad41a1c4202ee90aadc718ee6");
+ match = compare_surface(surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
ok(match, "Surface does not match.\n");
/* Invalid interpolation mode. */
@@ -1828,7 +1842,19 @@ static void test_bitmap_brush(void)
hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
- match = compare_surface(surface, "9437f4447d98feaad41a1c4202ee90aadc718ee6");
+ match = compare_surface(surface, "f5d039c280fa33ba05496c9883192a34108efbbe");
+ ok(match, "Surface does not match.\n");
+
+ ID2D1RenderTarget_BeginDraw(rt);
+ ID2D1RenderTarget_Clear(rt, &color);
+
+ set_rect(&src_rect, image_size.width, 0.0f, 0.0f, image_size.height);
+ ID2D1RenderTarget_DrawBitmap(rt, bitmap, NULL, 1.0f,
+ D2D1_BITMAP_INTERPOLATION_MODE_NEAREST_NEIGHBOR, &src_rect);
+
+ hr = ID2D1RenderTarget_EndDraw(rt, NULL, NULL);
+ ok(SUCCEEDED(hr), "Failed to end draw, hr %#x.\n", hr);
+ match = compare_surface(surface, "59043096393570ad800dbcbfdd644394b79493bd");
ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt);
--
2.29.2
3
8