From fb49ae52d55ca06770d3a66aa0def34326f6c0a1 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 18 Jul 2022 07:24:36 +1000 Subject: [PATCH] d3drm/tests: Show that viewport::render does not clear the background. Signed-off-by: Alistair Leslie-Hughes --- 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 a65a03c5b49..1dfddc25a64 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);