Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
There's a bit many of them now as I tried to split each individual change, to --hopefully-- make review easier.
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 d571cfe8d15..3f9159f9033 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;
@@ -9477,9 +9480,15 @@ static void test_math(void) {1.0f, 2.0f, 3.0f, 3.74165750f}, };
+ if (!pD2D1SinCos || !pD2D1Tan || !pD2D1Vec3Length) + { + 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), @@ -9488,14 +9497,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); } @@ -9505,8 +9514,12 @@ START_TEST(d2d1) { unsigned int argc, i; char **argv; + HMODULE d2d1_dll = GetModuleHandleA("d2d1.dll");
- 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");
And use it to factor device creation.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- 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 3f9159f9033..617d246485b 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("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,12 +1311,13 @@ static void test_clip(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_state_block(void) { + struct d2d1_test_context ctx; IDWriteRenderingParams *text_rendering_params1, *text_rendering_params2; D2D1_DRAWING_STATE_DESCRIPTION drawing_state; ID2D1DrawingStateBlock *state_block; @@ -1301,7 +1325,6 @@ static void test_state_block(void) 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,19 +1583,19 @@ static void test_state_block(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_color_brush(void) { + struct d2d1_test_context ctx; D2D1_MATRIX_3X2_F matrix, tmp_matrix; D2D1_BRUSH_PROPERTIES brush_desc; D2D1_COLOR_F color, tmp_color; 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,12 +1681,13 @@ static void test_color_brush(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_bitmap_brush(void) { + struct d2d1_test_context ctx; D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode; ID2D1TransformedGeometry *transformed_geometry; ID2D1RectangleGeometry *rectangle_geometry; @@ -1680,7 +1700,6 @@ static void test_bitmap_brush(void) ID2D1BitmapBrush1 *brush1; ID2D1BitmapBrush *brush; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F color; @@ -1721,13 +1740,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); @@ -1961,12 +1978,13 @@ static void test_bitmap_brush(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_linear_brush(void) { + struct d2d1_test_context ctx; D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES gradient_properties; ID2D1GradientStopCollection *gradient, *tmp_gradient; ID2D1TransformedGeometry *transformed_geometry; @@ -1976,7 +1994,6 @@ static void test_linear_brush(void) struct resource_readback rb; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F colour; @@ -2025,13 +2042,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); @@ -2167,12 +2182,13 @@ static void test_linear_brush(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_radial_brush(void) { + struct d2d1_test_context ctx; D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES gradient_properties; ID2D1GradientStopCollection *gradient, *tmp_gradient; ID2D1TransformedGeometry *transformed_geometry; @@ -2182,7 +2198,6 @@ static void test_radial_brush(void) struct resource_readback rb; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F colour; @@ -2231,13 +2246,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); @@ -2381,7 +2394,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); }
@@ -2502,6 +2515,7 @@ static void fill_geometry_sink_bezier(ID2D1GeometrySink *sink, unsigned int holl
static void test_path_geometry(void) { + struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry; D2D1_MATRIX_3X2_F matrix, tmp_matrix; ID2D1GeometrySink *sink, *tmp_sink; @@ -2512,7 +2526,6 @@ static void test_path_geometry(void) ID2D1Geometry *tmp_geometry; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; BOOL match, contains; @@ -2837,13 +2850,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); @@ -3571,7 +3582,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); }
@@ -3904,11 +3915,11 @@ static void test_rounded_rectangle_geometry(void)
static void test_bitmap_formats(void) { + struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; IDXGISwapChain *swapchain; D2D1_SIZE_U size = {4, 4}; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Bitmap *bitmap; unsigned int i, j; @@ -3938,13 +3949,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); @@ -3976,19 +3985,19 @@ static void test_bitmap_formats(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_alpha_mode(void) { + struct d2d1_test_context ctx; D2D1_RENDER_TARGET_PROPERTIES rt_desc; D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1SolidColorBrush *color_brush; ID2D1BitmapBrush *bitmap_brush; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Bitmap *bitmap; D2D1_COLOR_F color; @@ -4007,13 +4016,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); @@ -4205,12 +4212,13 @@ static void test_alpha_mode(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_shared_bitmap(void) { + struct d2d1_test_context ctx; IDXGISwapChain *swapchain1, *swapchain2; IWICBitmap *wic_bitmap1, *wic_bitmap2; ID2D1GdiInteropRenderTarget *interop; @@ -4219,7 +4227,7 @@ static void test_shared_bitmap(void) ID2D1RenderTarget *rt1, *rt2, *rt3; IDXGISurface *surface1, *surface2; ID2D1Factory *factory1, *factory2; - ID3D10Device1 *device1, *device2; + ID3D10Device1 *device2; IWICImagingFactory *wic_factory; ID2D1Bitmap *bitmap1, *bitmap2; DXGI_SURFACE_DESC surface_desc; @@ -4229,16 +4237,13 @@ static void test_shared_bitmap(void) 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); @@ -4459,7 +4464,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(); @@ -4467,10 +4472,10 @@ static void test_shared_bitmap(void)
static void test_bitmap_updates(void) { + struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; D2D1_RECT_U dst_rect; ID2D1Bitmap *bitmap; @@ -4489,13 +4494,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); @@ -4564,12 +4567,13 @@ static void test_bitmap_updates(void) ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_opacity_brush(void) { + struct d2d1_test_context ctx; ID2D1BitmapBrush *bitmap_brush, *opacity_brush; D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1RectangleGeometry *geometry; @@ -4577,7 +4581,6 @@ static void test_opacity_brush(void) IDXGISwapChain *swapchain; D2D1_MATRIX_3X2_F matrix; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; ID2D1Bitmap *bitmap; @@ -4597,13 +4600,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); @@ -4745,16 +4746,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; @@ -4775,13 +4776,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);
@@ -4836,12 +4835,13 @@ static void test_create_target(void) ID2D1Factory_Release(factory); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_draw_text_layout(void) { + struct d2d1_test_context ctx; static const struct { D2D1_TEXT_ANTIALIAS_MODE aa_mode; @@ -4877,7 +4877,6 @@ static void test_draw_text_layout(void) IDXGISwapChain *swapchain; ID2D1Factory *factory, *factory2; ID2D1RenderTarget *rt, *rt2; - ID3D10Device1 *device; IDXGISurface *surface; HWND window; HRESULT hr; @@ -4892,13 +4891,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);
@@ -5006,7 +5003,7 @@ todo_wine ID2D1Factory_Release(factory2); IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
@@ -5032,6 +5029,7 @@ static void create_target_dibsection(HDC hdc, UINT32 width, UINT32 height)
static void test_dc_target(void) { + struct d2d1_test_context ctx; static const D2D1_PIXEL_FORMAT invalid_formats[] = { { DXGI_FORMAT_UNKNOWN, D2D1_ALPHA_MODE_PREMULTIPLIED }, @@ -5047,7 +5045,6 @@ static void test_dc_target(void) ID2D1SolidColorBrush *brush; ID2D1RenderTarget *rt3; ID2D1Factory *factory; - ID3D10Device1 *device; FLOAT dpi_x, dpi_y; D2D1_COLOR_F color; D2D1_SIZE_U sizeu; @@ -5060,12 +5057,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); @@ -5263,22 +5257,19 @@ todo_wine
static void test_hwnd_target(void) { + struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; ID2D1GdiInteropRenderTarget *interop; D2D1_RENDER_TARGET_PROPERTIES desc; ID2D1HwndRenderTarget *rt, *rt2; 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); @@ -5426,6 +5417,7 @@ static void test_compatible_target_size_(unsigned int line, ID2D1RenderTarget *r
static void test_bitmap_target(void) { + struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; ID2D1GdiInteropRenderTarget *interop; D2D1_SIZE_U pixel_size, pixel_size2; @@ -5437,18 +5429,14 @@ static void test_bitmap_target(void) 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); @@ -5775,11 +5763,11 @@ static void test_stroke_style(void)
static void test_gradient(void) { + struct d2d1_test_context ctx; ID2D1GradientStopCollection *gradient; D2D1_GRADIENT_STOP stops[3], stops2[3]; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; D2D1_COLOR_F color; unsigned int i; @@ -5787,13 +5775,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); @@ -5827,12 +5813,13 @@ static void test_gradient(void)
IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); - ID3D10Device1_Release(device); + release_test_context(&ctx); DestroyWindow(window); }
static void test_draw_geometry(void) { + struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry[4]; ID2D1RectangleGeometry *rect_geometry[2]; D2D1_POINT_2F point = {0.0f, 0.0f}; @@ -5843,7 +5830,6 @@ static void test_draw_geometry(void) D2D1_MATRIX_3X2_F matrix; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_POINT_2F p0, p1; @@ -5855,13 +5841,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); @@ -6755,12 +6739,13 @@ 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); }
static void test_fill_geometry(void) { + struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry[4]; ID2D1RectangleGeometry *rect_geometry[2]; D2D1_POINT_2F point = {0.0f, 0.0f}; @@ -6771,7 +6756,6 @@ static void test_fill_geometry(void) D2D1_MATRIX_3X2_F matrix; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_ELLIPSE ellipse; @@ -6782,13 +6766,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); @@ -7569,12 +7551,13 @@ 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); }
static void test_gdi_interop(void) { + struct d2d1_test_context ctx; ID2D1GdiInteropRenderTarget *interop; D2D1_RENDER_TARGET_PROPERTIES desc; IWICImagingFactory *wic_factory; @@ -7582,18 +7565,14 @@ static void test_gdi_interop(void) 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); @@ -7704,14 +7683,15 @@ todo_wine
IWICBitmap_Release(wic_bitmap); ID2D1Factory_Release(factory); + release_test_context(&ctx); }
static void test_layer(void) { + struct d2d1_test_context ctx; ID2D1Factory *factory, *layer_factory; IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Layer *layer; D2D1_SIZE_F size; @@ -7719,13 +7699,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); @@ -7758,19 +7736,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) { + struct d2d1_test_context ctx; D2D1_POINT_2F point = {0.0f, 0.0f}; ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; IDXGISwapChain *swapchain; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F color; @@ -7779,13 +7757,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); @@ -7908,14 +7884,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) { + struct d2d1_test_context ctx; D2D1_CREATION_PROPERTIES properties = {0}; - ID3D10Device1 *d3d_device; IDXGIDevice *dxgi_device; ID2D1Factory1 *factory; ID2D1Factory *factory2; @@ -7923,20 +7899,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); @@ -7961,7 +7934,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); @@ -8157,6 +8130,7 @@ static IDXGISurface *create_surface(IDXGIDevice *dxgi_device, DXGI_FORMAT format
static void test_bitmap_surface(void) { + struct d2d1_test_context ctx; static const struct bitmap_format_test { D2D1_PIXEL_FORMAT original; @@ -8188,7 +8162,6 @@ static void test_bitmap_surface(void) ID2D1DeviceContext *device_context; IDXGISurface *surface, *surface2; D2D1_PIXEL_FORMAT pixel_format; - ID3D10Device1 *d3d_device; IDXGISwapChain *swapchain; IDXGIDevice *dxgi_device; ID2D1Factory1 *factory; @@ -8205,22 +8178,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); @@ -8242,7 +8212,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); @@ -8411,11 +8381,12 @@ static void test_bitmap_surface(void) CoUninitialize();
ID2D1Factory1_Release(factory); - ID3D10Device1_Release(d3d_device); + release_test_context(&ctx); }
static void test_device_context(void) { + struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; D2D1_RENDER_TARGET_PROPERTIES rt_desc; ID2D1DeviceContext *device_context; @@ -8423,7 +8394,6 @@ static void test_device_context(void) ID2D1Device *device, *device2; D2D1_BITMAP_OPTIONS options; ID2D1DCRenderTarget *dc_rt; - ID3D10Device1 *d3d_device; IDXGISwapChain *swapchain; IDXGIDevice *dxgi_device; D2D1_UNIT_MODE unit_mode; @@ -8439,20 +8409,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); @@ -8477,7 +8444,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); @@ -8617,7 +8584,7 @@ todo_wine
ID2D1Device_Release(device); ID2D1Factory1_Release(factory); - ID3D10Device1_Release(d3d_device); + release_test_context(&ctx); }
static void test_invert_matrix(void) @@ -8764,6 +8731,7 @@ static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, ID3D10D
static void test_command_list(void) { + struct d2d1_test_context ctx; static const DWORD bitmap_data[] = { 0xffff0000, 0xffffff00, 0xff00ff00, 0xff00ffff, @@ -8782,7 +8750,6 @@ static void test_command_list(void) D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1StrokeStyle *stroke_style; ID2D1CommandList *command_list; - ID3D10Device1 *d3d_device; ID2D1Geometry *geometry; ID2D1Factory1 *factory; ID2D1RenderTarget *rt; @@ -8796,20 +8763,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); @@ -8995,7 +8959,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); @@ -9012,6 +8976,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) @@ -9134,11 +9099,11 @@ static void test_max_bitmap_size(void)
static void test_dpi(void) { + struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES1 bitmap_desc; ID2D1DeviceContext *device_context; IWICImagingFactory *wic_factory; IDXGISwapChain *swapchain; - ID3D10Device1 *d3d_device; ID2D1Factory1 *factory; IDXGISurface *surface; ID2D1Bitmap1 *bitmap; @@ -9166,25 +9131,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); @@ -9353,18 +9315,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) { + struct d2d1_test_context ctx; IWICImagingFactory *wic_factory; IDXGISwapChain *swapchain; D2D1_PIXEL_FORMAT format; IWICBitmap *wic_bitmap; ID2D1RenderTarget *rt; - ID3D10Device1 *device; IDXGISurface *surface; ID2D1Bitmap *bitmap; unsigned int i; @@ -9383,13 +9345,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); @@ -9424,7 +9384,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); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 125 +++++++++++------------------------------ 1 file changed, 34 insertions(+), 91 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 617d246485b..bc9d7f83c8d 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) { + if (ctx->window) DestroyWindow(ctx->window); ID3D10Device1_Release(ctx->device); }
@@ -801,6 +803,14 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx) return FALSE; }
+ ctx->window = create_window(); + ok_(__FILE__, line)(ctx->window != NULL, "Failed to create test window.\n"); + if (!ctx->window) + { + release_test_context(ctx); + return FALSE; + } + return TRUE; }
@@ -1123,7 +1133,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 +1145,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 +1320,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 +1335,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 +1358,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 +1589,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 +1603,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 +1684,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) @@ -1708,7 +1709,6 @@ static void test_bitmap_brush(void) unsigned int i; ULONG refcount; float opacity; - HWND window; HRESULT hr; BOOL match;
@@ -1743,8 +1743,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); @@ -1979,7 +1978,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) @@ -2002,7 +2000,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[] = @@ -2045,8 +2042,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); @@ -2183,7 +2179,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) @@ -2205,7 +2200,6 @@ static void test_radial_brush(void) unsigned int i; ULONG refcount; D2D1_RECT_F r; - HWND window; HRESULT hr; float f;
@@ -2249,8 +2243,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); @@ -2395,7 +2388,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) @@ -2533,7 +2525,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[] = @@ -2853,8 +2844,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); @@ -3583,7 +3573,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) @@ -3923,7 +3912,6 @@ static void test_bitmap_formats(void) IDXGISurface *surface; ID2D1Bitmap *bitmap; unsigned int i, j; - HWND window; HRESULT hr;
static const struct @@ -3952,8 +3940,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); @@ -3986,7 +3973,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) @@ -4004,7 +3990,6 @@ static void test_alpha_mode(void) D2D1_RECT_F rect; D2D1_SIZE_U size; ULONG refcount; - HWND window; HRESULT hr; BOOL match;
@@ -4019,8 +4004,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); @@ -4213,7 +4197,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) @@ -4234,15 +4217,14 @@ static void test_shared_bitmap(void) D2D1_PIXEL_FORMAT pixel_format; D2D1_SIZE_U size = {4, 4}; IDXGISurface1 *surface3; - 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); @@ -4466,7 +4448,6 @@ static void test_shared_bitmap(void) ID3D10Device1_Release(device2); release_test_context(&ctx); DestroyWindow(window2); - DestroyWindow(window1); CoUninitialize(); }
@@ -4482,7 +4463,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;
@@ -4497,8 +4477,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); @@ -4568,7 +4547,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) @@ -4588,7 +4566,6 @@ static void test_opacity_brush(void) D2D1_RECT_F rect; D2D1_SIZE_U size; ULONG refcount; - HWND window; HRESULT hr; BOOL match;
@@ -4603,8 +4580,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); @@ -4747,7 +4723,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) @@ -4757,7 +4732,6 @@ static void test_create_target(void) ID2D1Factory *factory; ID2D1RenderTarget *rt; IDXGISurface *surface; - HWND window; HRESULT hr; static const struct { @@ -4779,8 +4753,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);
@@ -4836,7 +4809,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) @@ -4878,7 +4850,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; @@ -4894,8 +4865,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);
@@ -5004,7 +4974,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) @@ -5772,14 +5741,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); @@ -5814,7 +5781,6 @@ static void test_gradient(void) IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); release_test_context(&ctx); - DestroyWindow(window); }
static void test_draw_geometry(void) @@ -5837,15 +5803,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); @@ -6740,7 +6704,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) @@ -6762,15 +6725,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); @@ -7552,7 +7513,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) @@ -7696,14 +7656,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); @@ -7737,7 +7695,6 @@ static void test_layer(void) IDXGISurface_Release(surface); IDXGISwapChain_Release(swapchain); release_test_context(&ctx); - DestroyWindow(window); }
static void test_bezier_intersect(void) @@ -7753,15 +7710,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); @@ -7885,7 +7840,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) @@ -8172,7 +8126,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; @@ -8189,8 +8142,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); @@ -8401,7 +8353,6 @@ static void test_device_context(void) ID2D1RenderTarget *rt; ID2D1Bitmap1 *bitmap; ID2D1Image *target; - HWND window; HRESULT hr; RECT rect; HDC hdc; @@ -8443,8 +8394,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); @@ -8476,7 +8426,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); @@ -9108,7 +9057,6 @@ static void test_dpi(void) IDXGISurface *surface; ID2D1Bitmap1 *bitmap; float dpi_x, dpi_y; - HWND window; HRESULT hr;
static const struct @@ -9141,8 +9089,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);
@@ -9316,7 +9263,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) @@ -9330,7 +9276,6 @@ static void test_wic_bitmap_format(void) IDXGISurface *surface; ID2D1Bitmap *bitmap; unsigned int i; - HWND window; HRESULT hr;
static const struct @@ -9348,8 +9293,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); @@ -9385,7 +9329,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)
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 125 ++++++++++++----------------------------- 1 file changed, 35 insertions(+), 90 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index bc9d7f83c8d..1d18122146b 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 @@ -752,6 +753,7 @@ static IDXGISwapChain *create_swapchain(ID3D10Device1 *device, HWND window, BOOL ok(SUCCEEDED(hr), "Failed to create swapchain, hr %#x.\n", hr); IDXGIFactory_Release(factory);
+ if (FAILED(hr)) return NULL; return swapchain; }
@@ -788,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) { + if (ctx->swapchain) IDXGISwapChain_Release(ctx->swapchain); if (ctx->window) DestroyWindow(ctx->window); ID3D10Device1_Release(ctx->device); } @@ -811,6 +814,14 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx) return FALSE; }
+ ctx->swapchain = create_swapchain(ctx->device, ctx->window, TRUE); + ok_(__FILE__, line)(ctx->swapchain != NULL, "Failed to create test swapchain.\n"); + if (!ctx->swapchain) + { + release_test_context(ctx); + return FALSE; + } + return TRUE; }
@@ -1123,7 +1134,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; @@ -1145,8 +1155,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"); @@ -1318,7 +1327,6 @@ static void test_clip(void)
ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -1329,7 +1337,6 @@ static void test_state_block(void) D2D1_DRAWING_STATE_DESCRIPTION drawing_state; ID2D1DrawingStateBlock *state_block; IDWriteFactory *dwrite_factory; - IDXGISwapChain *swapchain; ID2D1Factory1 *factory1; ID2D1RenderTarget *rt; IDXGISurface *surface; @@ -1358,8 +1365,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"); @@ -1587,7 +1593,6 @@ static void test_state_block(void) ID2D1Factory_Release(factory); ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -1598,7 +1603,6 @@ static void test_color_brush(void) D2D1_BRUSH_PROPERTIES brush_desc; D2D1_COLOR_F color, tmp_color; ID2D1SolidColorBrush *brush; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; D2D1_RECT_F rect; @@ -1609,8 +1613,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"); @@ -1682,7 +1685,6 @@ static void test_color_brush(void) ID2D1SolidColorBrush_Release(brush); ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -1697,7 +1699,6 @@ static void test_bitmap_brush(void) ID2D1Bitmap *bitmap, *tmp_bitmap; D2D1_RECT_F src_rect, dst_rect; D2D1_EXTEND_MODE extend_mode; - IDXGISwapChain *swapchain; ID2D1BitmapBrush1 *brush1; ID2D1BitmapBrush *brush; ID2D1RenderTarget *rt; @@ -1743,8 +1744,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"); @@ -1976,7 +1976,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); }
@@ -1990,7 +1989,6 @@ static void test_linear_brush(void) D2D1_MATRIX_3X2_F matrix, tmp_matrix; ID2D1LinearGradientBrush *brush; struct resource_readback rb; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; ID2D1Factory *factory; @@ -2042,8 +2040,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"); @@ -2177,7 +2174,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); }
@@ -2191,7 +2187,6 @@ static void test_radial_brush(void) D2D1_MATRIX_3X2_F matrix, tmp_matrix; ID2D1RadialGradientBrush *brush; struct resource_readback rb; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; ID2D1Factory *factory; @@ -2243,8 +2238,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"); @@ -2386,7 +2380,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); }
@@ -2516,7 +2509,6 @@ static void test_path_geometry(void) ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; ID2D1Geometry *tmp_geometry; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; ID2D1Factory *factory; @@ -2844,8 +2836,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"); @@ -3571,7 +3562,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); }
@@ -3906,7 +3896,6 @@ static void test_bitmap_formats(void) { struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; - IDXGISwapChain *swapchain; D2D1_SIZE_U size = {4, 4}; ID2D1RenderTarget *rt; IDXGISurface *surface; @@ -3940,8 +3929,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"); @@ -3971,7 +3959,6 @@ static void test_bitmap_formats(void)
ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -3982,7 +3969,6 @@ static void test_alpha_mode(void) D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1SolidColorBrush *color_brush; ID2D1BitmapBrush *bitmap_brush; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; ID2D1Bitmap *bitmap; @@ -4004,8 +3990,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"); @@ -4195,14 +4180,13 @@ 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) { struct d2d1_test_context ctx; - IDXGISwapChain *swapchain1, *swapchain2; + IDXGISwapChain *swapchain2; IWICBitmap *wic_bitmap1, *wic_bitmap2; ID2D1GdiInteropRenderTarget *interop; D2D1_RENDER_TARGET_PROPERTIES desc; @@ -4224,9 +4208,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); @@ -4444,7 +4427,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); @@ -4455,7 +4437,6 @@ static void test_bitmap_updates(void) { struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; D2D1_RECT_U dst_rect; @@ -4477,8 +4458,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"); @@ -4545,7 +4525,6 @@ static void test_bitmap_updates(void) ID2D1Bitmap_Release(bitmap); ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -4556,7 +4535,6 @@ static void test_opacity_brush(void) D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1RectangleGeometry *geometry; ID2D1SolidColorBrush *color_brush; - IDXGISwapChain *swapchain; D2D1_MATRIX_3X2_F matrix; ID2D1RenderTarget *rt; IDXGISurface *surface; @@ -4580,8 +4558,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"); @@ -4721,14 +4698,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; @@ -4753,8 +4728,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); @@ -4807,7 +4781,6 @@ static void test_create_target(void)
ID2D1Factory_Release(factory); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -4846,7 +4819,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; @@ -4865,8 +4837,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); @@ -4972,7 +4943,6 @@ todo_wine ID2D1Factory_Release(factory); ID2D1Factory_Release(factory2); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -5735,7 +5705,6 @@ static void test_gradient(void) struct d2d1_test_context ctx; ID2D1GradientStopCollection *gradient; D2D1_GRADIENT_STOP stops[3], stops2[3]; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; D2D1_COLOR_F color; @@ -5746,8 +5715,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"); @@ -5779,7 +5747,6 @@ static void test_gradient(void) ID2D1RenderTarget_Release(rt);
IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
@@ -5792,7 +5759,6 @@ static void test_draw_geometry(void) D2D1_ROUNDED_RECT rounded_rect; ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; - IDXGISwapChain *swapchain; D2D1_MATRIX_3X2_F matrix; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; @@ -5809,8 +5775,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"); @@ -6702,7 +6667,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); }
@@ -6715,7 +6679,6 @@ static void test_fill_geometry(void) D2D1_ROUNDED_RECT rounded_rect; ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; - IDXGISwapChain *swapchain; D2D1_MATRIX_3X2_F matrix; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; @@ -6731,8 +6694,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"); @@ -7511,7 +7473,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); }
@@ -7650,7 +7611,6 @@ static void test_layer(void) { struct d2d1_test_context ctx; ID2D1Factory *factory, *layer_factory; - IDXGISwapChain *swapchain; ID2D1RenderTarget *rt; IDXGISurface *surface; ID2D1Layer *layer; @@ -7661,8 +7621,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"); @@ -7693,7 +7652,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); }
@@ -7703,7 +7661,6 @@ static void test_bezier_intersect(void) D2D1_POINT_2F point = {0.0f, 0.0f}; ID2D1SolidColorBrush *brush; ID2D1PathGeometry *geometry; - IDXGISwapChain *swapchain; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; IDXGISurface *surface; @@ -7716,8 +7673,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"); @@ -7838,7 +7794,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); }
@@ -8116,7 +8071,6 @@ static void test_bitmap_surface(void) ID2D1DeviceContext *device_context; IDXGISurface *surface, *surface2; D2D1_PIXEL_FORMAT pixel_format; - IDXGISwapChain *swapchain; IDXGIDevice *dxgi_device; ID2D1Factory1 *factory; ID2D1RenderTarget *rt; @@ -8142,8 +8096,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"); @@ -8346,7 +8299,6 @@ static void test_device_context(void) ID2D1Device *device, *device2; D2D1_BITMAP_OPTIONS options; ID2D1DCRenderTarget *dc_rt; - IDXGISwapChain *swapchain; IDXGIDevice *dxgi_device; D2D1_UNIT_MODE unit_mode; ID2D1Factory1 *factory; @@ -8394,8 +8346,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"); @@ -9052,7 +9003,6 @@ static void test_dpi(void) D2D1_BITMAP_PROPERTIES1 bitmap_desc; ID2D1DeviceContext *device_context; IWICImagingFactory *wic_factory; - IDXGISwapChain *swapchain; ID2D1Factory1 *factory; IDXGISurface *surface; ID2D1Bitmap1 *bitmap; @@ -9089,8 +9039,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); @@ -9260,7 +9209,6 @@ static void test_dpi(void)
ID2D1DeviceContext_Release(device_context); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); ID2D1Factory1_Release(factory); release_test_context(&ctx); } @@ -9269,7 +9217,6 @@ static void test_wic_bitmap_format(void) { struct d2d1_test_context ctx; IWICImagingFactory *wic_factory; - IDXGISwapChain *swapchain; D2D1_PIXEL_FORMAT format; IWICBitmap *wic_bitmap; ID2D1RenderTarget *rt; @@ -9293,8 +9240,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"); @@ -9327,7 +9273,6 @@ static void test_wic_bitmap_format(void) CoUninitialize(); ID2D1RenderTarget_Release(rt); IDXGISurface_Release(surface); - IDXGISwapChain_Release(swapchain); release_test_context(&ctx); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 507 +++++++++++++++++------------------------ 1 file changed, 215 insertions(+), 292 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 1d18122146b..d6f5e670276 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 @@ -790,6 +791,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) { + if (ctx->surface) IDXGISurface_Release(ctx->surface); if (ctx->swapchain) IDXGISwapChain_Release(ctx->swapchain); if (ctx->window) DestroyWindow(ctx->window); ID3D10Device1_Release(ctx->device); @@ -798,6 +800,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())) @@ -822,6 +826,14 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx) return FALSE; }
+ hr = IDXGISwapChain_GetBuffer(ctx->swapchain, 0, &IID_IDXGISurface, (void **)&ctx->surface); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + if (FAILED(hr)) + { + release_test_context(ctx); + return FALSE; + } + return TRUE; }
@@ -1137,7 +1149,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; @@ -1155,9 +1166,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); @@ -1256,7 +1265,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. */ @@ -1322,11 +1331,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); }
@@ -1339,7 +1347,6 @@ static void test_state_block(void) IDWriteFactory *dwrite_factory; ID2D1Factory1 *factory1; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; ULONG refcount; HRESULT hr; @@ -1365,9 +1372,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); @@ -1592,7 +1597,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); }
@@ -1604,7 +1608,6 @@ static void test_color_brush(void) D2D1_COLOR_F color, tmp_color; ID2D1SolidColorBrush *brush; ID2D1RenderTarget *rt; - IDXGISurface *surface; D2D1_RECT_F rect; float opacity; HRESULT hr; @@ -1613,9 +1616,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); @@ -1679,12 +1680,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); }
@@ -1702,7 +1702,6 @@ static void test_bitmap_brush(void) ID2D1BitmapBrush1 *brush1; ID2D1BitmapBrush *brush; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F color; ID2D1Image *image; @@ -1744,9 +1743,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); @@ -1834,7 +1831,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, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); + match = compare_surface(ctx.surface, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); ok(match, "Surface does not match.\n");
/* Invalid interpolation mode. */ @@ -1847,7 +1844,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, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); + match = compare_surface(ctx.surface, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt); @@ -1876,7 +1873,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); @@ -1925,7 +1922,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))) @@ -1975,7 +1972,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); }
@@ -1990,7 +1986,6 @@ static void test_linear_brush(void) ID2D1LinearGradientBrush *brush; struct resource_readback rb; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F colour; D2D1_POINT_2F p; @@ -2040,9 +2035,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); @@ -2084,7 +2077,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; @@ -2157,7 +2150,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; @@ -2173,7 +2166,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); }
@@ -2188,7 +2180,6 @@ static void test_radial_brush(void) ID2D1RadialGradientBrush *brush; struct resource_readback rb; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F colour; D2D1_POINT_2F p; @@ -2238,9 +2229,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); @@ -2288,7 +2277,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; @@ -2363,7 +2352,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; @@ -2379,7 +2368,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); }
@@ -2510,7 +2498,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; @@ -2836,9 +2823,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);
@@ -3224,7 +3209,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. */ @@ -3305,7 +3290,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); @@ -3365,7 +3350,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" @@ -3375,7 +3360,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" @@ -3385,7 +3370,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" @@ -3397,7 +3382,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" @@ -3461,21 +3446,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" @@ -3484,7 +3469,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" @@ -3528,7 +3513,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);
@@ -3561,7 +3546,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); }
@@ -3898,7 +3882,6 @@ static void test_bitmap_formats(void) D2D1_BITMAP_PROPERTIES bitmap_desc; D2D1_SIZE_U size = {4, 4}; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Bitmap *bitmap; unsigned int i, j; HRESULT hr; @@ -3929,9 +3912,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; @@ -3958,7 +3939,6 @@ static void test_bitmap_formats(void) }
ID2D1RenderTarget_Release(rt); - IDXGISurface_Release(surface); release_test_context(&ctx); }
@@ -3970,7 +3950,6 @@ static void test_alpha_mode(void) ID2D1SolidColorBrush *color_brush; ID2D1BitmapBrush *bitmap_brush; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Bitmap *bitmap; D2D1_COLOR_F color; D2D1_RECT_F rect; @@ -3990,9 +3969,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); @@ -4019,7 +3996,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); @@ -4027,7 +4004,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); @@ -4035,7 +4012,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); @@ -4076,7 +4053,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); @@ -4087,7 +4064,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); @@ -4114,7 +4091,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); @@ -4122,7 +4099,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); @@ -4130,7 +4107,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); @@ -4171,7 +4148,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); @@ -4179,7 +4156,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); }
@@ -4192,7 +4168,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; ID3D10Device1 *device2; IWICImagingFactory *wic_factory; @@ -4209,8 +4185,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);
@@ -4245,7 +4219,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); @@ -4425,7 +4399,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); @@ -4438,7 +4411,6 @@ static void test_bitmap_updates(void) struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; ID2D1RenderTarget *rt; - IDXGISurface *surface; D2D1_RECT_U dst_rect; ID2D1Bitmap *bitmap; D2D1_COLOR_F color; @@ -4458,9 +4430,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); @@ -4519,12 +4489,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); }
@@ -4537,7 +4506,6 @@ static void test_opacity_brush(void) ID2D1SolidColorBrush *color_brush; D2D1_MATRIX_3X2_F matrix; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; ID2D1Bitmap *bitmap; D2D1_COLOR_F color; @@ -4558,9 +4526,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);
@@ -4646,7 +4612,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);
@@ -4688,7 +4654,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); @@ -4697,7 +4663,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); }
@@ -4706,7 +4671,6 @@ static void test_create_target(void) struct d2d1_test_context ctx; ID2D1Factory *factory; ID2D1RenderTarget *rt; - IDXGISurface *surface; HRESULT hr; static const struct { @@ -4728,8 +4692,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); @@ -4750,7 +4712,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);
@@ -4780,7 +4742,6 @@ static void test_create_target(void) }
ID2D1Factory_Release(factory); - IDXGISurface_Release(surface); release_test_context(&ctx); }
@@ -4821,7 +4782,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; @@ -4837,8 +4797,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); @@ -4855,10 +4813,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); @@ -4942,7 +4900,6 @@ todo_wine
ID2D1Factory_Release(factory); ID2D1Factory_Release(factory2); - IDXGISurface_Release(surface); release_test_context(&ctx); }
@@ -5706,7 +5663,6 @@ static void test_gradient(void) ID2D1GradientStopCollection *gradient; D2D1_GRADIENT_STOP stops[3], stops2[3]; ID2D1RenderTarget *rt; - IDXGISurface *surface; D2D1_COLOR_F color; unsigned int i; UINT32 count; @@ -5715,9 +5671,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; @@ -5746,7 +5700,6 @@ static void test_gradient(void) ID2D1GradientStopCollection_Release(gradient); ID2D1RenderTarget_Release(rt);
- IDXGISurface_Release(surface); release_test_context(&ctx); }
@@ -5762,7 +5715,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; @@ -5775,9 +5727,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);
@@ -5824,18 +5774,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" @@ -5843,18 +5793,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" @@ -5863,18 +5813,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" @@ -5917,18 +5867,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" @@ -5937,18 +5887,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" @@ -5957,18 +5907,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" @@ -6011,18 +5961,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" @@ -6031,18 +5981,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" @@ -6051,18 +6001,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" @@ -6154,18 +6104,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" @@ -6173,9 +6123,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" @@ -6184,7 +6134,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" @@ -6193,7 +6143,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" @@ -6202,7 +6152,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" @@ -6211,7 +6161,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" @@ -6266,7 +6216,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" @@ -6274,7 +6224,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" @@ -6282,7 +6232,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" @@ -6301,7 +6251,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" @@ -6437,7 +6387,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" @@ -6445,7 +6395,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" @@ -6453,7 +6403,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" @@ -6461,7 +6411,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" @@ -6470,7 +6420,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" @@ -6479,7 +6429,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" @@ -6490,7 +6440,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" @@ -6501,7 +6451,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" @@ -6511,7 +6461,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" @@ -6520,7 +6470,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" @@ -6529,7 +6479,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" @@ -6538,7 +6488,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" @@ -6617,7 +6567,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" @@ -6626,13 +6576,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" @@ -6646,7 +6596,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" @@ -6666,7 +6616,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); }
@@ -6682,7 +6631,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; @@ -6694,9 +6642,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);
@@ -6731,25 +6677,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"); @@ -6789,37 +6735,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"); @@ -6859,37 +6805,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"); @@ -6978,43 +6924,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" @@ -7066,18 +7012,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" @@ -7088,7 +7034,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" @@ -7216,70 +7162,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" @@ -7355,19 +7301,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" @@ -7378,7 +7324,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" @@ -7459,20 +7405,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); }
@@ -7612,7 +7557,6 @@ static void test_layer(void) struct d2d1_test_context ctx; ID2D1Factory *factory, *layer_factory; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Layer *layer; D2D1_SIZE_F size; ULONG refcount; @@ -7621,9 +7565,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);
@@ -7651,7 +7593,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); }
@@ -7663,7 +7604,6 @@ static void test_bezier_intersect(void) ID2D1PathGeometry *geometry; ID2D1GeometrySink *sink; ID2D1RenderTarget *rt; - IDXGISurface *surface; ID2D1Factory *factory; D2D1_COLOR_F color; ULONG refcount; @@ -7673,9 +7613,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);
@@ -7720,7 +7658,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" @@ -7770,7 +7708,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" @@ -7793,7 +7731,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); }
@@ -8069,7 +8006,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; IDXGIDevice *dxgi_device; ID2D1Factory1 *factory; @@ -8096,9 +8033,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); @@ -8132,7 +8067,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);
@@ -8150,7 +8085,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); @@ -8171,7 +8106,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); @@ -8229,7 +8164,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; @@ -8346,9 +8280,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); @@ -8359,13 +8291,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); @@ -8376,7 +8308,6 @@ static void test_device_context(void)
ID2D1DeviceContext_Release(device_context); ID2D1RenderTarget_Release(rt); - IDXGISurface_Release(surface);
/* WIC target */ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); @@ -9004,7 +8935,6 @@ static void test_dpi(void) ID2D1DeviceContext *device_context; IWICImagingFactory *wic_factory; ID2D1Factory1 *factory; - IDXGISurface *surface; ID2D1Bitmap1 *bitmap; float dpi_x, dpi_y; HRESULT hr; @@ -9039,8 +8969,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"); @@ -9060,7 +8988,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);
@@ -9208,7 +9136,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); } @@ -9220,7 +9147,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; @@ -9240,9 +9166,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);
@@ -9272,7 +9196,6 @@ static void test_wic_bitmap_format(void) IWICImagingFactory_Release(wic_factory); CoUninitialize(); ID2D1RenderTarget_Release(rt); - IDXGISurface_Release(surface); release_test_context(&ctx); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 104 +++++++++++++++++++---------------------- 1 file changed, 47 insertions(+), 57 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index d6f5e670276..55628ef11ff 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 @@ -770,6 +771,7 @@ static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface, const ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); ID2D1Factory_Release(factory);
+ if (FAILED(hr)) return NULL; return render_target; }
@@ -791,6 +793,17 @@ 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; + + if (ctx->rt) + { + ID2D1RenderTarget_GetFactory(ctx->rt, &factory); + ID2D1RenderTarget_Release(ctx->rt); + ref = ID2D1Factory_Release(factory); + ok(!ref, "Factory has %u references left.\n", ref); + } + if (ctx->surface) IDXGISurface_Release(ctx->surface); if (ctx->swapchain) IDXGISwapChain_Release(ctx->swapchain); if (ctx->window) DestroyWindow(ctx->window); @@ -834,6 +847,14 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx) return FALSE; }
+ ctx->rt = create_render_target(ctx->surface); + ok(!!ctx->rt, "Failed to create render target.\n"); + if (!ctx->rt) + { + release_test_context(ctx); + return FALSE; + } + return TRUE; }
@@ -1166,8 +1187,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_GetDpi(rt, &dpi_x, &dpi_y); ok(dpi_x == 96.0f, "Got unexpected dpi_x %.8e.\n", dpi_x); @@ -1372,8 +1392,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"); + ID2D1RenderTarget_AddRef(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); @@ -1616,8 +1635,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); @@ -1743,8 +1761,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); @@ -2035,8 +2052,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); @@ -2229,8 +2245,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); @@ -2502,7 +2517,6 @@ static void test_path_geometry(void) BOOL match, contains; D2D1_COLOR_F color; D2D1_RECT_F rect; - ULONG refcount; UINT32 count; HRESULT hr;
@@ -2823,8 +2837,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -3544,8 +3557,7 @@ static void test_path_geometry(void)
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); }
@@ -3912,8 +3924,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
bitmap_desc.dpiX = 96.0f; bitmap_desc.dpiY = 96.0f; @@ -3969,8 +3980,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -4430,8 +4440,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED);
@@ -4526,8 +4535,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -4661,8 +4669,7 @@ static void test_opacity_brush(void) 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); }
@@ -5671,8 +5678,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
stops2[0].position = 0.5f; set_color(&stops2[0].color, 1.0f, 1.0f, 0.0f, 1.0f); @@ -5720,15 +5726,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -6614,8 +6618,7 @@ static void test_draw_geometry(void)
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); }
@@ -6635,15 +6638,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -7416,8 +7417,7 @@ static void test_fill_geometry(void)
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); }
@@ -7559,14 +7559,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -7591,8 +7589,7 @@ static void test_layer(void) 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); }
@@ -7606,15 +7603,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); ID2D1RenderTarget_GetFactory(rt, &factory);
ID2D1RenderTarget_SetDpi(rt, 192.0f, 48.0f); @@ -7729,8 +7724,7 @@ static void test_bezier_intersect(void)
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); }
@@ -8033,8 +8027,7 @@ static void test_bitmap_surface(void) }
/* DXGI target */ - rt = create_render_target(ctx.surface); - ok(!!rt, "Failed to create render target.\n"); + ID2D1RenderTarget_AddRef(rt = ctx.rt);
hr = ID2D1RenderTarget_QueryInterface(rt, &IID_ID2D1DeviceContext, (void **)&device_context); ok(SUCCEEDED(hr), "Failed to get device context, hr %#x.\n", hr); @@ -8280,8 +8273,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"); + ID2D1RenderTarget_AddRef(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); @@ -8805,8 +8797,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); }
@@ -9166,8 +9157,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"); + ID2D1RenderTarget_AddRef(rt = ctx.rt); CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);
hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
Signed-off-by: Rémi Bernon rbernon@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 55628ef11ff..fe36fd6e84c 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); }
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 46 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index fe36fd6e84c..370c971cd7c 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);
@@ -1288,7 +1288,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. */ @@ -1354,7 +1354,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");
ID2D1RenderTarget_Release(rt); @@ -1701,7 +1701,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); @@ -1851,7 +1851,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, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); + match = compare_surface(&ctx, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); ok(match, "Surface does not match.\n");
/* Invalid interpolation mode. */ @@ -1864,7 +1864,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, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); + match = compare_surface(&ctx, "9437f4447d98feaad41a1c4202ee90aadc718ee6"); ok(match, "Surface does not match.\n");
ID2D1RenderTarget_BeginDraw(rt); @@ -1893,7 +1893,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); @@ -1942,7 +1942,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))) @@ -3225,7 +3225,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. */ @@ -3306,7 +3306,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); @@ -3529,7 +3529,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);
@@ -4009,7 +4009,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); @@ -4017,7 +4017,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); @@ -4025,7 +4025,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); @@ -4066,7 +4066,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");
ID2D1RenderTarget_Release(rt); @@ -4104,7 +4104,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); @@ -4112,7 +4112,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); @@ -4120,7 +4120,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); @@ -4161,7 +4161,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); @@ -4501,7 +4501,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); @@ -4623,7 +4623,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);
@@ -4665,7 +4665,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);
Signed-off-by: Rémi Bernon rbernon@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 370c971cd7c..94d56338cd4 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; @@ -3366,7 +3366,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" @@ -3376,7 +3376,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" @@ -3386,7 +3386,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" @@ -3398,7 +3398,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" @@ -3462,21 +3462,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" @@ -3485,7 +3485,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" @@ -5781,18 +5781,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" @@ -5800,18 +5800,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" @@ -5820,18 +5820,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" @@ -5874,18 +5874,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" @@ -5894,18 +5894,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" @@ -5914,18 +5914,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" @@ -5968,18 +5968,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" @@ -5988,18 +5988,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" @@ -6008,18 +6008,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" @@ -6111,18 +6111,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" @@ -6130,9 +6130,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" @@ -6141,7 +6141,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" @@ -6150,7 +6150,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" @@ -6159,7 +6159,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" @@ -6168,7 +6168,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" @@ -6223,7 +6223,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" @@ -6231,7 +6231,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" @@ -6239,7 +6239,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" @@ -6258,7 +6258,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" @@ -6394,7 +6394,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" @@ -6402,7 +6402,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" @@ -6410,7 +6410,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" @@ -6418,7 +6418,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" @@ -6427,7 +6427,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" @@ -6436,7 +6436,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" @@ -6447,7 +6447,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" @@ -6458,7 +6458,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" @@ -6468,7 +6468,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" @@ -6477,7 +6477,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" @@ -6486,7 +6486,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" @@ -6495,7 +6495,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" @@ -6574,7 +6574,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" @@ -6583,13 +6583,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" @@ -6603,7 +6603,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" @@ -6681,25 +6681,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"); @@ -6739,37 +6739,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"); @@ -6809,37 +6809,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"); @@ -6928,43 +6928,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" @@ -7016,18 +7016,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" @@ -7038,7 +7038,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" @@ -7166,70 +7166,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" @@ -7305,19 +7305,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" @@ -7328,7 +7328,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" @@ -7409,13 +7409,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); @@ -7656,7 +7656,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" @@ -7706,7 +7706,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"
And to release_resource_readback for future use.
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 94d56338cd4..eb611aa1f20 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -311,8 +311,9 @@ static void cubic_to(ID2D1GeometrySink *sink, float x1, float y1, float x2, floa ID2D1GeometrySink_AddBezier(sink, &b); }
-static void get_surface_readback(IDXGISurface *surface, struct resource_readback *rb) +static void get_surface_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) { + IDXGISurface *surface = ctx->surface; D3D10_TEXTURE2D_DESC texture_desc; D3D10_MAPPED_TEXTURE2D map_desc; DXGI_SURFACE_DESC surface_desc; @@ -354,7 +355,7 @@ static void get_surface_readback(IDXGISurface *surface, struct resource_readback rb->data = map_desc.pData; }
-static void release_resource_readback(struct resource_readback *rb) +static void release_resource_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) { ID3D10Texture2D_Unmap((ID3D10Texture2D *)rb->resource, 0); ID3D10Resource_Release(rb->resource); @@ -466,9 +467,9 @@ static BOOL compare_surface(struct d2d1_test_context *ctx, const char *ref_sha1) struct resource_readback rb; BOOL ret;
- get_surface_readback(ctx->surface, &rb); + get_surface_readback(ctx, &rb); ret = compare_sha1(rb.data, rb.pitch, 4, rb.width, rb.height, ref_sha1); - release_resource_readback(&rb); + release_resource_readback(ctx, &rb);
return ret; } @@ -638,7 +639,7 @@ static BOOL compare_figure(struct d2d1_test_context *ctx, unsigned int x, unsign unsigned int i, j, span, diff; struct resource_readback rb;
- get_surface_readback(ctx->surface, &rb); + get_surface_readback(ctx, &rb);
figure.span_count = 0; figure.spans_size = 64; @@ -688,7 +689,7 @@ static BOOL compare_figure(struct d2d1_test_context *ctx, unsigned int x, unsign
HeapFree(GetProcessHeap(), 0, ref_figure.spans); HeapFree(GetProcessHeap(), 0, figure.spans); - release_resource_readback(&rb); + release_resource_readback(ctx, &rb);
return diff <= max_diff; } @@ -2096,7 +2097,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(ctx.surface, &rb); + get_surface_readback(&ctx, &rb); for (i = 0; i < ARRAY_SIZE(test1); ++i) { DWORD colour; @@ -2106,7 +2107,7 @@ static void test_linear_brush(void) "Got unexpected colour 0x%08x at position {%u, %u}.\n", colour, test1[i].x, test1[i].y); } - release_resource_readback(&rb); + release_resource_readback(&ctx, &rb);
ID2D1RenderTarget_BeginDraw(rt);
@@ -2169,7 +2170,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(ctx.surface, &rb); + get_surface_readback(&ctx, &rb); for (i = 0; i < ARRAY_SIZE(test2); ++i) { DWORD colour; @@ -2179,7 +2180,7 @@ static void test_linear_brush(void) "Got unexpected colour 0x%08x at position {%u, %u}.\n", colour, test2[i].x, test2[i].y); } - release_resource_readback(&rb); + release_resource_readback(&ctx, &rb);
ID2D1LinearGradientBrush_Release(brush); refcount = ID2D1GradientStopCollection_Release(gradient); @@ -2295,7 +2296,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(ctx.surface, &rb); + get_surface_readback(&ctx, &rb); for (i = 0; i < ARRAY_SIZE(test1); ++i) { DWORD colour; @@ -2305,7 +2306,7 @@ static void test_radial_brush(void) "Got unexpected colour 0x%08x at position {%u, %u}.\n", colour, test1[i].x, test1[i].y); } - release_resource_readback(&rb); + release_resource_readback(&ctx, &rb);
ID2D1RenderTarget_BeginDraw(rt);
@@ -2370,7 +2371,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(ctx.surface, &rb); + get_surface_readback(&ctx, &rb); for (i = 0; i < ARRAY_SIZE(test2); ++i) { DWORD colour; @@ -2380,7 +2381,7 @@ static void test_radial_brush(void) "Got unexpected colour 0x%08x at position {%u, %u}.\n", colour, test2[i].x, test2[i].y); } - release_resource_readback(&rb); + release_resource_readback(&ctx, &rb);
ID2D1RadialGradientBrush_Release(brush); refcount = ID2D1GradientStopCollection_Release(gradient);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/d2d1.c | 68 +++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 24 deletions(-)
diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index eb611aa1f20..798f98c335b 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -44,7 +44,7 @@ size_t mt_tests_size, mt_test_count;
struct d2d1_test_context { - ID3D10Device1 *device; + IDXGIDevice *device; HWND window; IDXGISwapChain *swapchain; IDXGISurface *surface; @@ -694,7 +694,7 @@ static BOOL compare_figure(struct d2d1_test_context *ctx, unsigned int x, unsign return diff <= max_diff; }
-static ID3D10Device1 *create_device(void) +static ID3D10Device1 *create_d3d10_device(void) { ID3D10Device1 *device;
@@ -711,6 +711,25 @@ static ID3D10Device1 *create_device(void) return NULL; }
+static IDXGIDevice *create_device(void) +{ + ID3D10Device1 *d3d10_device; + IDXGIDevice *device; + HRESULT hr; + + if (!(d3d10_device = create_d3d10_device())) + return NULL; + + hr = ID3D10Device1_QueryInterface(d3d10_device, &IID_IDXGIDevice, (void **)&device); + ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr); + ID3D10Device1_Release(d3d10_device); + + if (FAILED(hr)) + return NULL; + + return device; +} + static HWND create_window(void) { RECT r = {0, 0, 640, 480}; @@ -721,20 +740,16 @@ static HWND create_window(void) 0, 0, r.right - r.left, r.bottom - r.top, NULL, NULL, NULL, NULL); }
-static IDXGISwapChain *create_swapchain(ID3D10Device1 *device, HWND window, BOOL windowed) +static IDXGISwapChain *create_swapchain(IDXGIDevice *device, HWND window, BOOL windowed) { IDXGISwapChain *swapchain; DXGI_SWAP_CHAIN_DESC desc; - IDXGIDevice *dxgi_device; IDXGIAdapter *adapter; IDXGIFactory *factory; HRESULT hr;
- hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); - ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr); - hr = IDXGIDevice_GetAdapter(dxgi_device, &adapter); + hr = IDXGIDevice_GetAdapter(device, &adapter); ok(SUCCEEDED(hr), "Failed to get adapter, hr %#x.\n", hr); - IDXGIDevice_Release(dxgi_device); hr = IDXGIAdapter_GetParent(adapter, &IID_IDXGIFactory, (void **)&factory); ok(SUCCEEDED(hr), "Failed to get factory, hr %#x.\n", hr); IDXGIAdapter_Release(adapter); @@ -763,6 +778,19 @@ static IDXGISwapChain *create_swapchain(ID3D10Device1 *device, HWND window, BOOL return swapchain; }
+static IDXGISwapChain *create_d3d10_swapchain(ID3D10Device1 *device, HWND window, BOOL windowed) +{ + IDXGISwapChain *swapchain; + IDXGIDevice *dxgi_device; + HRESULT hr; + + hr = ID3D10Device1_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); + ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr); + swapchain = create_swapchain(dxgi_device, window, windowed); + IDXGIDevice_Release(dxgi_device); + return swapchain; +} + static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) { ID2D1RenderTarget *render_target; @@ -811,7 +839,7 @@ static void release_test_context_(unsigned int line, struct d2d1_test_context *c if (ctx->surface) IDXGISurface_Release(ctx->surface); if (ctx->swapchain) IDXGISwapChain_Release(ctx->swapchain); if (ctx->window) DestroyWindow(ctx->window); - ID3D10Device1_Release(ctx->device); + IDXGIDevice_Release(ctx->device); }
#define init_test_context(ctx) init_test_context_(__LINE__, ctx) @@ -4184,7 +4212,7 @@ static void test_shared_bitmap(void) ID2D1RenderTarget *rt1, *rt2, *rt3; IDXGISurface *surface2; ID2D1Factory *factory1, *factory2; - ID3D10Device1 *device2; + IDXGIDevice *device2; IWICImagingFactory *wic_factory; ID2D1Bitmap *bitmap1, *bitmap2; DXGI_SURFACE_DESC surface_desc; @@ -4414,7 +4442,7 @@ static void test_shared_bitmap(void) IWICBitmap_Release(wic_bitmap1); IDXGISurface_Release(surface2); IDXGISwapChain_Release(swapchain2); - ID3D10Device1_Release(device2); + IDXGIDevice_Release(device2); release_test_context(&ctx); DestroyWindow(window2); CoUninitialize(); @@ -7753,8 +7781,7 @@ static void test_create_device(void) return; }
- hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device); - ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr); + IDXGIDevice_AddRef(dxgi_device = ctx.device);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr); @@ -8049,8 +8076,7 @@ static void test_bitmap_surface(void) 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); + IDXGIDevice_AddRef(dxgi_device = ctx.device);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr); @@ -8253,8 +8279,7 @@ static void test_device_context(void) return; }
- hr = ID3D10Device1_QueryInterface(ctx.device, &IID_IDXGIDevice, (void **)&dxgi_device); - ok(SUCCEEDED(hr), "Failed to get IDXGIDevice interface, hr %#x.\n", hr); + IDXGIDevice_AddRef(dxgi_device = ctx.device);
hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, &device); ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr); @@ -8535,19 +8560,14 @@ static void test_skew_matrix(void) } }
-static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, ID3D10Device1 *d3d_device) +static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device) { ID2D1DeviceContext *device_context; - IDXGIDevice *dxgi_device; ID2D1Device *device; HRESULT hr;
- hr = ID3D10Device1_QueryInterface(d3d_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); ok(SUCCEEDED(hr), "Failed to get ID2D1Device, hr %#x.\n", hr); - IDXGIDevice_Release(dxgi_device);
hr = ID2D1Device_CreateDeviceContext(device, D2D1_DEVICE_CONTEXT_OPTIONS_NONE, &device_context); ok(SUCCEEDED(hr), "Failed to create device context, hr %#x.\n", hr); @@ -8855,7 +8875,7 @@ static void test_max_bitmap_size(void) }
window = create_window(); - swapchain = create_swapchain(device, window, TRUE); + swapchain = create_d3d10_swapchain(device, window, TRUE); hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface); ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/d2d1/tests/Makefile.in | 2 +- dlls/d2d1/tests/d2d1.c | 344 +++++++++++++++++++++++++----------- 2 files changed, 239 insertions(+), 107 deletions(-)
diff --git a/dlls/d2d1/tests/Makefile.in b/dlls/d2d1/tests/Makefile.in index 91ede7888aa..5eeb815e07f 100644 --- a/dlls/d2d1/tests/Makefile.in +++ b/dlls/d2d1/tests/Makefile.in @@ -1,5 +1,5 @@ TESTDLL = d2d1.dll -IMPORTS = d2d1 d3d10_1 dwrite dxguid uuid user32 advapi32 ole32 gdi32 +IMPORTS = d2d1 d3d10_1 d3d11 dwrite dxguid uuid user32 advapi32 ole32 gdi32
C_SRCS = \ d2d1.c diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 798f98c335b..05b6429f491 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -21,6 +21,7 @@ #include <math.h> #include <float.h> #include "d2d1_1.h" +#include "d3d11.h" #include "wincrypt.h" #include "wine/test.h" #include "initguid.h" @@ -38,12 +39,14 @@ static BOOL use_mt = TRUE;
static struct test_entry { - void (*test)(void); + void (*test)(BOOL d3d11); + BOOL d3d11; } *mt_tests; size_t mt_tests_size, mt_test_count;
struct d2d1_test_context { + BOOL d3d11; IDXGIDevice *device; HWND window; IDXGISwapChain *swapchain; @@ -53,7 +56,11 @@ struct d2d1_test_context
struct resource_readback { - ID3D10Resource *resource; + union + { + ID3D10Resource *d3d10_resource; + ID3D11Resource *d3d11_resource; + } u; unsigned int pitch, width, height; void *data; }; @@ -108,14 +115,26 @@ struct expected_geometry_figure const struct geometry_segment *segments; };
-static void queue_test(void (*test)(void)) +static void queue_d3d1x_test(void (*test)(BOOL d3d11), BOOL d3d11) { if (mt_test_count >= mt_tests_size) { mt_tests_size = max(16, mt_tests_size * 2); mt_tests = heap_realloc(mt_tests, mt_tests_size * sizeof(*mt_tests)); } - mt_tests[mt_test_count++].test = test; + mt_tests[mt_test_count].test = test; + mt_tests[mt_test_count++].d3d11 = d3d11; +} + +static void queue_d3d10_test(void (*test)(BOOL d3d11)) +{ + queue_d3d1x_test(test, FALSE); +} + +static void queue_test(void (*test)(BOOL d3d11)) +{ + queue_d3d1x_test(test, FALSE); + queue_d3d1x_test(test, TRUE); }
static DWORD WINAPI thread_func(void *ctx) @@ -126,7 +145,7 @@ static DWORD WINAPI thread_func(void *ctx) { j = *i; if (InterlockedCompareExchange(i, j + 1, j) == j) - mt_tests[j].test(); + mt_tests[j].test(mt_tests[j].d3d11); }
return 0; @@ -143,7 +162,7 @@ static void run_queued_tests(void) { for (i = 0; i < mt_test_count; ++i) { - mt_tests[i].test(); + mt_tests[i].test(mt_tests[i].d3d11); }
return; @@ -311,7 +330,7 @@ static void cubic_to(ID2D1GeometrySink *sink, float x1, float y1, float x2, floa ID2D1GeometrySink_AddBezier(sink, &b); }
-static void get_surface_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) +static void get_d3d10_surface_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) { IDXGISurface *surface = ctx->surface; D3D10_TEXTURE2D_DESC texture_desc; @@ -338,27 +357,104 @@ static void get_surface_readback(struct d2d1_test_context *ctx, struct resource_ texture_desc.BindFlags = 0; texture_desc.CPUAccessFlags = D3D10_CPU_ACCESS_READ; texture_desc.MiscFlags = 0; - hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D10Texture2D **)&rb->resource); + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D10Texture2D **)&rb->u.d3d10_resource); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr);
rb->width = texture_desc.Width; rb->height = texture_desc.Height;
- ID3D10Device_CopyResource(device, rb->resource, src_resource); + ID3D10Device_CopyResource(device, rb->u.d3d10_resource, src_resource); ID3D10Resource_Release(src_resource); ID3D10Device_Release(device);
- hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->resource, 0, D3D10_MAP_READ, 0, &map_desc); + hr = ID3D10Texture2D_Map((ID3D10Texture2D *)rb->u.d3d10_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 get_d3d11_surface_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) +{ + IDXGISurface *surface = ctx->surface; + D3D11_TEXTURE2D_DESC texture_desc; + D3D11_MAPPED_SUBRESOURCE map_desc; + DXGI_SURFACE_DESC surface_desc; + ID3D11Resource *src_resource; + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + + hr = IDXGISurface_GetDevice(surface, &IID_ID3D11Device, (void **)&device); + ok(SUCCEEDED(hr), "Failed to get device, hr %#x.\n", hr); + hr = IDXGISurface_QueryInterface(surface, &IID_ID3D11Resource, (void **)&src_resource); + ok(SUCCEEDED(hr), "Failed to query resource interface, hr %#x.\n", hr); + + hr = IDXGISurface_GetDesc(surface, &surface_desc); + ok(SUCCEEDED(hr), "Failed to get surface desc, hr %#x.\n", hr); + texture_desc.Width = surface_desc.Width; + texture_desc.Height = surface_desc.Height; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = surface_desc.Format; + texture_desc.SampleDesc = surface_desc.SampleDesc; + texture_desc.Usage = D3D11_USAGE_STAGING; + texture_desc.BindFlags = 0; + texture_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + texture_desc.MiscFlags = 0; + hr = ID3D11Device_CreateTexture2D(device, &texture_desc, NULL, (ID3D11Texture2D **)&rb->u.d3d11_resource); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + rb->width = texture_desc.Width; + rb->height = texture_desc.Height; + + ID3D11Device_GetImmediateContext(device, &context); + ID3D11DeviceContext_CopyResource(context, rb->u.d3d11_resource, src_resource); + ID3D11Resource_Release(src_resource); + ID3D11Device_Release(device); + + hr = ID3D11DeviceContext_Map(context, (ID3D11Resource *)rb->u.d3d11_resource, 0, D3D11_MAP_READ, 0, &map_desc); ok(SUCCEEDED(hr), "Failed to map texture, hr %#x.\n", hr); + ID3D11DeviceContext_Release(context);
rb->pitch = map_desc.RowPitch; rb->data = map_desc.pData; }
+static void get_surface_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) +{ + if (ctx->d3d11) get_d3d11_surface_readback(ctx, rb); + else get_d3d10_surface_readback(ctx, rb); +} + +static void release_d3d10_resource_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) +{ + ID3D10Texture2D_Unmap((ID3D10Texture2D *)rb->u.d3d10_resource, 0); + ID3D10Resource_Release(rb->u.d3d10_resource); +} + +static void release_d3d11_resource_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) +{ + IDXGISurface *surface = ctx->surface; + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + + hr = IDXGISurface_GetDevice(surface, &IID_ID3D11Device, (void **)&device); + ok(SUCCEEDED(hr), "Failed to get device, hr %#x.\n", hr); + + ID3D11Device_GetImmediateContext(device, &context); + ID3D11Device_Release(device); + + ID3D11DeviceContext_Unmap(context, rb->u.d3d11_resource, 0); + ID3D11Resource_Release(rb->u.d3d11_resource); + ID3D11DeviceContext_Release(context); +} + static void release_resource_readback(struct d2d1_test_context *ctx, struct resource_readback *rb) { - ID3D10Texture2D_Unmap((ID3D10Texture2D *)rb->resource, 0); - ID3D10Resource_Release(rb->resource); + if (ctx->d3d11) release_d3d11_resource_readback(ctx, rb); + else release_d3d10_resource_readback(ctx, rb); }
static DWORD get_readback_colour(struct resource_readback *rb, unsigned int x, unsigned int y) @@ -711,19 +807,47 @@ static ID3D10Device1 *create_d3d10_device(void) return NULL; }
-static IDXGIDevice *create_device(void) +static ID3D11Device *create_d3d11_device(void) +{ + ID3D11Device *device; + DWORD level = D3D_FEATURE_LEVEL_11_0; + + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, + D3D10_CREATE_DEVICE_BGRA_SUPPORT, &level, 1, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_WARP, NULL, + D3D10_CREATE_DEVICE_BGRA_SUPPORT, &level, 1, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + if (SUCCEEDED(D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_REFERENCE, NULL, + D3D10_CREATE_DEVICE_BGRA_SUPPORT, &level, 1, D3D11_SDK_VERSION, &device, NULL, NULL))) + return device; + + return NULL; +} + +static IDXGIDevice *create_device(BOOL d3d11) { ID3D10Device1 *d3d10_device; + ID3D11Device *d3d11_device; IDXGIDevice *device; HRESULT hr;
- if (!(d3d10_device = create_d3d10_device())) - return NULL; + if (d3d11) + { + if (!(d3d11_device = create_d3d11_device())) + return NULL; + hr = ID3D11Device_QueryInterface(d3d11_device, &IID_IDXGIDevice, (void **)&device); + ID3D11Device_Release(d3d11_device); + } + else + { + if (!(d3d10_device = create_d3d10_device())) + return NULL; + hr = ID3D10Device1_QueryInterface(d3d10_device, &IID_IDXGIDevice, (void **)&device); + ID3D10Device1_Release(d3d10_device); + }
- hr = ID3D10Device1_QueryInterface(d3d10_device, &IID_IDXGIDevice, (void **)&device); ok(SUCCEEDED(hr), "Failed to get DXGI device, hr %#x.\n", hr); - ID3D10Device1_Release(d3d10_device); - if (FAILED(hr)) return NULL;
@@ -791,7 +915,7 @@ static IDXGISwapChain *create_d3d10_swapchain(ID3D10Device1 *device, HWND window return swapchain; }
-static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc) +static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface, const D2D1_RENDER_TARGET_PROPERTIES *desc, BOOL d3d11) { ID2D1RenderTarget *render_target; ID2D1Factory *factory; @@ -800,14 +924,14 @@ static ID2D1RenderTarget *create_render_target_desc(IDXGISurface *surface, const hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory); ok(SUCCEEDED(hr), "Failed to create factory, hr %#x.\n", hr); hr = ID2D1Factory_CreateDxgiSurfaceRenderTarget(factory, surface, desc, &render_target); - ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); + todo_wine_if(d3d11) ok(SUCCEEDED(hr), "Failed to create render target, hr %#x.\n", hr); ID2D1Factory_Release(factory);
if (FAILED(hr)) return NULL; return render_target; }
-static ID2D1RenderTarget *create_render_target(IDXGISurface *surface) +static ID2D1RenderTarget *create_render_target(IDXGISurface *surface, BOOL d3d11) { D2D1_RENDER_TARGET_PROPERTIES desc;
@@ -819,7 +943,7 @@ static ID2D1RenderTarget *create_render_target(IDXGISurface *surface) desc.usage = D2D1_RENDER_TARGET_USAGE_NONE; desc.minLevel = D2D1_FEATURE_LEVEL_DEFAULT;
- return create_render_target_desc(surface, &desc); + return create_render_target_desc(surface, &desc, d3d11); }
#define release_test_context(ctx) release_test_context_(__LINE__, ctx) @@ -842,14 +966,15 @@ static void release_test_context_(unsigned int line, struct d2d1_test_context *c IDXGIDevice_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) +#define init_test_context(ctx, d3d11) init_test_context_(__LINE__, ctx, d3d11) +static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx, BOOL d3d11) { HRESULT hr;
memset(ctx, 0, sizeof(*ctx));
- if (!(ctx->device = create_device())) + ctx->d3d11 = d3d11; + if (!(ctx->device = create_device(d3d11))) { skip("Failed to create device, skipping tests.\n"); return FALSE; @@ -879,7 +1004,14 @@ static BOOL init_test_context_(unsigned int line, struct d2d1_test_context *ctx) return FALSE; }
- ctx->rt = create_render_target(ctx->surface); + ctx->rt = create_render_target(ctx->surface, d3d11); + if (!ctx->rt && d3d11) + { + todo_wine win_skip_(__FILE__, line)("Skipping D3D11 tests.\n"); + release_test_context(ctx); + return FALSE; + } + ok(!!ctx->rt, "Failed to create render target.\n"); if (!ctx->rt) { @@ -1196,7 +1328,7 @@ static void geometry_sink_check_(unsigned int line, const struct geometry_sink * } }
-static void test_clip(void) +static void test_clip(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_MATRIX_3X2_F matrix; @@ -1216,7 +1348,7 @@ static void test_clip(void) 0.0f, 0.0f, }}};
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -1390,7 +1522,7 @@ static void test_clip(void) release_test_context(&ctx); }
-static void test_state_block(void) +static void test_state_block(BOOL d3d11) { struct d2d1_test_context ctx; IDWriteRenderingParams *text_rendering_params1, *text_rendering_params2; @@ -1421,7 +1553,7 @@ static void test_state_block(void) 11.0f, 12.0f, }}};
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -1651,7 +1783,7 @@ static void test_state_block(void) release_test_context(&ctx); }
-static void test_color_brush(void) +static void test_color_brush(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_MATRIX_3X2_F matrix, tmp_matrix; @@ -1664,7 +1796,7 @@ static void test_color_brush(void) HRESULT hr; BOOL match;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -1738,7 +1870,7 @@ static void test_color_brush(void) release_test_context(&ctx); }
-static void test_bitmap_brush(void) +static void test_bitmap_brush(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_BITMAP_INTERPOLATION_MODE interpolation_mode; @@ -1790,7 +1922,7 @@ static void test_bitmap_brush(void) 0xffffffff, 0xff000000, 0xff000000, 0xff000000, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -2024,7 +2156,7 @@ static void test_bitmap_brush(void) release_test_context(&ctx); }
-static void test_linear_brush(void) +static void test_linear_brush(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_LINEAR_GRADIENT_BRUSH_PROPERTIES gradient_properties; @@ -2081,7 +2213,7 @@ static void test_linear_brush(void) {520, 390, 0xff90ae40}, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -2217,7 +2349,7 @@ static void test_linear_brush(void) release_test_context(&ctx); }
-static void test_radial_brush(void) +static void test_radial_brush(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_RADIAL_GRADIENT_BRUSH_PROPERTIES gradient_properties; @@ -2274,7 +2406,7 @@ static void test_radial_brush(void) {520, 390, 0xff4059e6}, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -2533,7 +2665,7 @@ static void fill_geometry_sink_bezier(ID2D1GeometrySink *sink, unsigned int holl ID2D1GeometrySink_EndFigure(sink, D2D1_FIGURE_END_CLOSED); }
-static void test_path_geometry(void) +static void test_path_geometry(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry; @@ -2866,7 +2998,7 @@ static void test_path_geometry(void) {D2D1_FIGURE_BEGIN_HOLLOW, D2D1_FIGURE_END_OPEN, { 40.0f, 20.0f}, 2, &expected_segments[172]}, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -3593,7 +3725,7 @@ static void test_path_geometry(void) release_test_context(&ctx); }
-static void test_rectangle_geometry(void) +static void test_rectangle_geometry(BOOL d3d11) { ID2D1TransformedGeometry *transformed_geometry; ID2D1RectangleGeometry *geometry; @@ -3874,7 +4006,7 @@ static void test_rectangle_geometry(void) ID2D1Factory_Release(factory); }
-static void test_rounded_rectangle_geometry(void) +static void test_rounded_rectangle_geometry(BOOL d3d11) { ID2D1RoundedRectangleGeometry *geometry; D2D1_ROUNDED_RECT rect, rect2; @@ -3920,7 +4052,7 @@ static void test_rounded_rectangle_geometry(void) ID2D1Factory_Release(factory); }
-static void test_bitmap_formats(void) +static void test_bitmap_formats(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; @@ -3953,7 +4085,7 @@ static void test_bitmap_formats(void) {DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, 0x8a}, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -3985,7 +4117,7 @@ static void test_bitmap_formats(void) release_test_context(&ctx); }
-static void test_alpha_mode(void) +static void test_alpha_mode(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_RENDER_TARGET_PROPERTIES rt_desc; @@ -4009,7 +4141,7 @@ static void test_alpha_mode(void) 0x7f7f7f7f, 0x7f000000, 0x7f000000, 0x7f000000, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -4106,7 +4238,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(ctx.surface, &rt_desc); + rt = create_render_target_desc(ctx.surface, &rt_desc, d3d11); ok(!!rt, "Failed to create render target.\n");
ID2D1RenderTarget_SetAntialiasMode(rt, D2D1_ANTIALIAS_MODE_ALIASED); @@ -4201,7 +4333,7 @@ static void test_alpha_mode(void) release_test_context(&ctx); }
-static void test_shared_bitmap(void) +static void test_shared_bitmap(BOOL d3d11) { struct d2d1_test_context ctx; IDXGISwapChain *swapchain2; @@ -4222,7 +4354,7 @@ static void test_shared_bitmap(void) HWND window2; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
window2 = create_window(); @@ -4287,7 +4419,7 @@ static void test_shared_bitmap(void) /* DXGI surface render targets with different devices but the same factory. */ IDXGISurface_Release(surface2); IDXGISwapChain_Release(swapchain2); - device2 = create_device(); + device2 = create_device(d3d11); ok(!!device2, "Failed to create device.\n"); swapchain2 = create_swapchain(device2, window2, TRUE); hr = IDXGISwapChain_GetBuffer(swapchain2, 0, &IID_IDXGISurface, (void **)&surface2); @@ -4448,7 +4580,7 @@ static void test_shared_bitmap(void) CoUninitialize(); }
-static void test_bitmap_updates(void) +static void test_bitmap_updates(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES bitmap_desc; @@ -4469,7 +4601,7 @@ static void test_bitmap_updates(void) 0xffffffff, 0xff000000, 0xff000000, 0xff000000, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -4538,7 +4670,7 @@ static void test_bitmap_updates(void) release_test_context(&ctx); }
-static void test_opacity_brush(void) +static void test_opacity_brush(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1BitmapBrush *bitmap_brush, *opacity_brush; @@ -4564,7 +4696,7 @@ static void test_opacity_brush(void) 0xffffffff, 0x40000000, 0x40000000, 0xff000000, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -4705,7 +4837,7 @@ static void test_opacity_brush(void) release_test_context(&ctx); }
-static void test_create_target(void) +static void test_create_target(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1Factory *factory; @@ -4728,7 +4860,7 @@ static void test_create_target(void) }; unsigned int i;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
@@ -4784,7 +4916,7 @@ static void test_create_target(void) release_test_context(&ctx); }
-static void test_draw_text_layout(void) +static void test_draw_text_layout(BOOL d3d11) { struct d2d1_test_context ctx; static const struct @@ -4833,7 +4965,7 @@ static void test_draw_text_layout(void) D2D1_RECT_F rect; unsigned int i;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
@@ -4962,7 +5094,7 @@ static void create_target_dibsection(HDC hdc, UINT32 width, UINT32 height) DeleteObject(SelectObject(hdc, hbm)); }
-static void test_dc_target(void) +static void test_dc_target(BOOL d3d11) { struct d2d1_test_context ctx; static const D2D1_PIXEL_FORMAT invalid_formats[] = @@ -4992,7 +5124,7 @@ static void test_dc_target(void) HRESULT hr; RECT rect;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return; release_test_context(&ctx);
@@ -5190,7 +5322,7 @@ todo_wine ID2D1Factory_Release(factory); }
-static void test_hwnd_target(void) +static void test_hwnd_target(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; @@ -5202,7 +5334,7 @@ static void test_hwnd_target(void) D2D1_SIZE_U size; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return; release_test_context(&ctx);
@@ -5350,7 +5482,7 @@ static void test_compatible_target_size_(unsigned int line, ID2D1RenderTarget *r ID2D1BitmapRenderTarget_Release(bitmap_rt); }
-static void test_bitmap_target(void) +static void test_bitmap_target(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; @@ -5369,7 +5501,7 @@ static void test_bitmap_target(void) ULONG refcount; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return; release_test_context(&ctx);
@@ -5536,7 +5668,7 @@ static void test_bitmap_target(void) ID2D1Factory_Release(factory); }
-static void test_desktop_dpi(void) +static void test_desktop_dpi(BOOL d3d11) { ID2D1Factory *factory; float dpi_x, dpi_y; @@ -5552,7 +5684,7 @@ static void test_desktop_dpi(void) ID2D1Factory_Release(factory); }
-static void test_stroke_style(void) +static void test_stroke_style(BOOL d3d11) { static const struct { @@ -5696,7 +5828,7 @@ static void test_stroke_style(void) ID2D1Factory_Release(factory); }
-static void test_gradient(void) +static void test_gradient(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1GradientStopCollection *gradient; @@ -5707,7 +5839,7 @@ static void test_gradient(void) UINT32 count; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -5741,7 +5873,7 @@ static void test_gradient(void) release_test_context(&ctx); }
-static void test_draw_geometry(void) +static void test_draw_geometry(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry[4]; @@ -5761,7 +5893,7 @@ static void test_draw_geometry(void) HRESULT hr; BOOL match;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -6654,7 +6786,7 @@ static void test_draw_geometry(void) release_test_context(&ctx); }
-static void test_fill_geometry(void) +static void test_fill_geometry(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1TransformedGeometry *transformed_geometry[4]; @@ -6673,7 +6805,7 @@ static void test_fill_geometry(void) HRESULT hr; BOOL match;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -7453,7 +7585,7 @@ static void test_fill_geometry(void) release_test_context(&ctx); }
-static void test_gdi_interop(void) +static void test_gdi_interop(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1GdiInteropRenderTarget *interop; @@ -7469,7 +7601,7 @@ static void test_gdi_interop(void) RECT rect; HDC dc;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory, NULL, (void **)&factory); @@ -7584,7 +7716,7 @@ todo_wine release_test_context(&ctx); }
-static void test_layer(void) +static void test_layer(BOOL d3d11) { struct d2d1_test_context ctx; ID2D1Factory *factory, *layer_factory; @@ -7593,7 +7725,7 @@ static void test_layer(void) D2D1_SIZE_F size; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -7625,7 +7757,7 @@ static void test_layer(void) release_test_context(&ctx); }
-static void test_bezier_intersect(void) +static void test_bezier_intersect(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_POINT_2F point = {0.0f, 0.0f}; @@ -7638,7 +7770,7 @@ static void test_bezier_intersect(void) HRESULT hr; BOOL match;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -7760,7 +7892,7 @@ static void test_bezier_intersect(void) release_test_context(&ctx); }
-static void test_create_device(void) +static void test_create_device(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_CREATION_PROPERTIES properties = {0}; @@ -7771,7 +7903,7 @@ static void test_create_device(void) ULONG refcount; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) @@ -7999,7 +8131,7 @@ static IDXGISurface *create_surface(IDXGIDevice *dxgi_device, DXGI_FORMAT format return surface; }
-static void test_bitmap_surface(void) +static void test_bitmap_surface(BOOL d3d11) { struct d2d1_test_context ctx; static const struct bitmap_format_test @@ -8047,7 +8179,7 @@ static void test_bitmap_surface(void) IWICBitmap *wic_bitmap; IWICImagingFactory *wic_factory;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) @@ -8246,7 +8378,7 @@ static void test_bitmap_surface(void) release_test_context(&ctx); }
-static void test_device_context(void) +static void test_device_context(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_HWND_RENDER_TARGET_PROPERTIES hwnd_rt_desc; @@ -8269,7 +8401,7 @@ static void test_device_context(void) IWICBitmap *wic_bitmap; IWICImagingFactory *wic_factory;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) @@ -8439,7 +8571,7 @@ todo_wine release_test_context(&ctx); }
-static void test_invert_matrix(void) +static void test_invert_matrix(BOOL d3d11) { static const struct { @@ -8522,7 +8654,7 @@ static void test_invert_matrix(void) } }
-static void test_skew_matrix(void) +static void test_skew_matrix(BOOL d3d11) { static const struct { @@ -8560,7 +8692,7 @@ static void test_skew_matrix(void) } }
-static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device) +static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, IDXGIDevice *dxgi_device, BOOL d3d11) { ID2D1DeviceContext *device_context; ID2D1Device *device; @@ -8576,7 +8708,7 @@ static ID2D1DeviceContext *create_device_context(ID2D1Factory1 *factory, IDXGIDe return device_context; }
-static void test_command_list(void) +static void test_command_list(BOOL d3d11) { struct d2d1_test_context ctx; static const DWORD bitmap_data[] = @@ -8610,7 +8742,7 @@ static void test_command_list(void) ULONG refcount; HRESULT hr;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) @@ -8620,7 +8752,7 @@ static void test_command_list(void) return; }
- device_context = create_device_context(factory, ctx.device); + device_context = create_device_context(factory, ctx.device, d3d11); ok(device_context != NULL, "Failed to create device context.\n");
hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list); @@ -8806,7 +8938,7 @@ todo_wine ID2D1CommandList_Release(command_list);
/* List created with different context. */ - device_context2 = create_device_context(factory, ctx.device); + device_context2 = create_device_context(factory, ctx.device, d3d11); ok(device_context2 != NULL, "Failed to create device context.\n");
hr = ID2D1DeviceContext_CreateCommandList(device_context, &command_list); @@ -8825,7 +8957,7 @@ todo_wine release_test_context(&ctx); }
-static void test_max_bitmap_size(void) +static void test_max_bitmap_size(BOOL d3d11) { D2D1_RENDER_TARGET_PROPERTIES desc; D2D1_BITMAP_PROPERTIES bitmap_desc; @@ -8943,7 +9075,7 @@ static void test_max_bitmap_size(void) ID2D1Factory_Release(factory); }
-static void test_dpi(void) +static void test_dpi(BOOL d3d11) { struct d2d1_test_context ctx; D2D1_BITMAP_PROPERTIES1 bitmap_desc; @@ -8974,7 +9106,7 @@ static void test_dpi(void) static const float dc_dpi_x = 120.0f, dc_dpi_y = 144.0f; unsigned int i;
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
if (FAILED(D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &IID_ID2D1Factory1, NULL, (void **)&factory))) @@ -8985,7 +9117,7 @@ static void test_dpi(void) }
- device_context = create_device_context(factory, ctx.device); + device_context = create_device_context(factory, ctx.device, d3d11); ok(!!device_context, "Failed to create device context.\n");
ID2D1DeviceContext_GetDpi(device_context, &dpi_x, &dpi_y); @@ -9155,7 +9287,7 @@ static void test_dpi(void) release_test_context(&ctx); }
-static void test_wic_bitmap_format(void) +static void test_wic_bitmap_format(BOOL d3d11) { struct d2d1_test_context ctx; IWICImagingFactory *wic_factory; @@ -9178,7 +9310,7 @@ static void test_wic_bitmap_format(void) {&GUID_WICPixelFormat32bppBGR, {DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE}}, };
- if (!init_test_context(&ctx)) + if (!init_test_context(&ctx, d3d11)) return;
ID2D1RenderTarget_AddRef(rt = ctx.rt); @@ -9213,7 +9345,7 @@ static void test_wic_bitmap_format(void) release_test_context(&ctx); }
-static void test_math(void) +static void test_math(BOOL d3d11) { float s, c, t, l; unsigned int i; @@ -9322,8 +9454,8 @@ START_TEST(d2d1) queue_test(test_linear_brush); queue_test(test_radial_brush); queue_test(test_path_geometry); - queue_test(test_rectangle_geometry); - queue_test(test_rounded_rectangle_geometry); + queue_d3d10_test(test_rectangle_geometry); + queue_d3d10_test(test_rounded_rectangle_geometry); queue_test(test_bitmap_formats); queue_test(test_alpha_mode); queue_test(test_shared_bitmap); @@ -9334,8 +9466,8 @@ START_TEST(d2d1) queue_test(test_dc_target); queue_test(test_hwnd_target); queue_test(test_bitmap_target); - queue_test(test_desktop_dpi); - queue_test(test_stroke_style); + queue_d3d10_test(test_desktop_dpi); + queue_d3d10_test(test_stroke_style); queue_test(test_gradient); queue_test(test_draw_geometry); queue_test(test_fill_geometry); @@ -9345,13 +9477,13 @@ START_TEST(d2d1) queue_test(test_create_device); queue_test(test_bitmap_surface); queue_test(test_device_context); - queue_test(test_invert_matrix); - queue_test(test_skew_matrix); + queue_d3d10_test(test_invert_matrix); + queue_d3d10_test(test_skew_matrix); queue_test(test_command_list); - queue_test(test_max_bitmap_size); + queue_d3d10_test(test_max_bitmap_size); queue_test(test_dpi); queue_test(test_wic_bitmap_format); - queue_test(test_math); + queue_d3d10_test(test_math);
run_queued_tests(); }