d2d1/tests: Make the window client rect match the DXGI swapchain dimensions.
Similar to e.g. commit 65f20ffc50
. There's
no compelling reason for the tests themselves, but it does simplify
debugging them a little.
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e37ba63d2f
commit
70e68e1234
|
@ -463,6 +463,16 @@ static ID3D10Device1 *create_device(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HWND create_window(void)
|
||||||
|
{
|
||||||
|
RECT r = {0, 0, 640, 480};
|
||||||
|
|
||||||
|
AdjustWindowRect(&r, WS_OVERLAPPEDWINDOW | WS_VISIBLE, FALSE);
|
||||||
|
|
||||||
|
return CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
||||||
|
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(ID3D10Device1 *device, HWND window, BOOL windowed)
|
||||||
{
|
{
|
||||||
IDXGISwapChain *swapchain;
|
IDXGISwapChain *swapchain;
|
||||||
|
@ -562,8 +572,7 @@ static void test_clip(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -714,8 +723,7 @@ static void test_state_block(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -910,8 +918,7 @@ static void test_color_brush(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -1045,8 +1052,7 @@ static void test_bitmap_brush(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -1333,8 +1339,7 @@ static void test_path_geometry(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -1942,8 +1947,7 @@ static void test_bitmap_formats(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -2012,8 +2016,7 @@ static void test_alpha_mode(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -2234,10 +2237,8 @@ static void test_shared_bitmap(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window1 = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window1 = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
window2 = create_window();
|
||||||
window2 = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain1 = create_swapchain(device1, window1, TRUE);
|
swapchain1 = create_swapchain(device1, window1, TRUE);
|
||||||
swapchain2 = create_swapchain(device1, window2, TRUE);
|
swapchain2 = create_swapchain(device1, window2, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain1, 0, &IID_IDXGISurface, (void **)&surface1);
|
hr = IDXGISwapChain_GetBuffer(swapchain1, 0, &IID_IDXGISurface, (void **)&surface1);
|
||||||
|
@ -2436,8 +2437,7 @@ static void test_bitmap_updates(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -2545,8 +2545,7 @@ static void test_opacity_brush(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -2724,8 +2723,7 @@ static void test_create_target(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -2797,8 +2795,7 @@ static void test_draw_text_layout(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
@ -3494,8 +3491,7 @@ static void test_gradient(void)
|
||||||
skip("Failed to create device, skipping tests.\n");
|
skip("Failed to create device, skipping tests.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window = CreateWindowA("static", "d2d1_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE,
|
window = create_window();
|
||||||
0, 0, 640, 480, NULL, NULL, NULL, NULL);
|
|
||||||
swapchain = create_swapchain(device, window, TRUE);
|
swapchain = create_swapchain(device, window, TRUE);
|
||||||
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_IDXGISurface, (void **)&surface);
|
||||||
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr);
|
||||||
|
|
Loading…
Reference in New Issue