Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
-- v2: d3drm/tests: Show Clear sets background color
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/d3drm/tests/d3drm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 5745fea4b09..6b56480600e 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -7116,6 +7116,12 @@ static void test_viewport_clear1(void) ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame1, 1);
+ hr = IDirect3DRMViewport_Render(viewport1, frame1); + ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr); + + ret_color = get_surface_color(surface, 320, 240); + ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); + hr = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 0.0f, 0.0f, 1.0f); ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); ret_color = IDirect3DRMFrame_GetSceneBackground(frame1); @@ -7321,6 +7327,12 @@ static void test_viewport_clear2(void) ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame3, 1);
+ hr = IDirect3DRMViewport2_Render(viewport2, frame3); + ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr); + + ret_color = get_surface_color(surface, 320, 240); + ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); + hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport); ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface, hr %#lx.\n", hr);
Jeffrey Smith (@whydoubt) commented about dlls/d3drm/tests/d3drm.c:
ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame1, 1);
- hr = IDirect3DRMViewport_Render(viewport1, frame1);
- ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr);
- ret_color = get_surface_color(surface, 320, 240);
- ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color);
If the goal is to show that Render does not perform its own clear, I think _one_ of the following approaches would be better: 1) Move the Render above the Clear and compare_color with the original surface color, _OR_ 2) Set the scene background to a different color after Clear but before the Render.
I slightly prefer 1, FWIW.
Jeffrey Smith (@whydoubt) commented about dlls/d3drm/tests/d3drm.c:
ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color); CHECK_REFCOUNT(frame3, 1);
- hr = IDirect3DRMViewport2_Render(viewport2, frame3);
- ok(SUCCEEDED(hr), "Cannot Render, hr %#lx\n", hr);
- ret_color = get_surface_color(surface, 320, 240);
- ok(compare_color(ret_color, 0x00ffffff, 1), "Got unexpected color 0x%08lx.\n", ret_color);
Same comment as above.