Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
-- v5: 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 | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 2166c8eaf2a..f10881aa05f 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -7122,6 +7122,15 @@ 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 = IDirect3DRMFrame_SetSceneBackgroundRGB(frame1, 0.5f, 0.5f, 0.5f); + ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); + + 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); @@ -7327,6 +7336,18 @@ 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 = IDirect3DRMFrame3_SetSceneBackgroundRGB(frame3, 0.5f, 0.5f, 0.5f); + ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); + + 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 = IDirect3DRMFrame3_SetSceneBackgroundRGB(frame3, 1.0f, 1.0f, 1.0f); + ok(SUCCEEDED(hr), "Cannot set scene background RGB, hr %#lx\n", hr); + hr = IDirect3DRMViewport2_GetDirect3DViewport(viewport2, &d3d_viewport); ok(SUCCEEDED(hr), "Cannot get IDirect3DViewport interface, hr %#lx.\n", hr);
This looks mostly good to me now!
The commit topic is a bit misleading by now though. I think something like "d3drm/tests: Show that viewport::render does not clear the background" would be better.
I must say I am a bit confused by the way gitlab shows the diff and why the testbot reports failures. Afaics the failures are in a different test though.
I must say I am a bit confused by the way gitlab shows the diff and why the testbot reports failures. Afaics the failures are in a different test though.
I struggled with figuring this out too, but eventually realized that with b0f0dc8a, the changed background color (0.5,0.5,0.5/0x7f7f7f) was being picked up by a subsequent Clear. 46434c88 restores the background color after the Render test, so everything looks good now.
On Thu Jul 28 19:20:42 2022 +0000, Jeffrey Smith wrote:
I must say I am a bit confused by the way gitlab shows the diff and
why the testbot reports failures. Afaics the failures are in a different test though. I struggled with figuring this out too, but eventually realized that with b12afe42, the changed background color (0.5,0.5,0.5/0x7f7f7f) was being picked up by a subsequent Clear. 46434c88 restores the background color after the Render test, so everything looks good now.
@alesliehughes I think the only issue remaining with this was changing the commit topic, as suggested by @stefan. All other concerns appear to have been addressed, but the threads were never marked as resolved. If you could push the commit topic change, maybe this could be out of the open MR list soon.