Signed-off-by: Stefan Dösinger stefan@codeweavers.com --- dlls/ddraw/tests/ddraw1.c | 28 ++++++++++++++++++++++------ dlls/ddraw/tests/ddraw2.c | 28 ++++++++++++++++++++++------ dlls/ddraw/tests/ddraw4.c | 26 ++++++++++++++++++++------ dlls/ddraw/tests/ddraw7.c | 26 ++++++++++++++++++++------ 4 files changed, 84 insertions(+), 24 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 671beeaa8e..81f2680ca4 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -10838,9 +10838,21 @@ static void test_clear(void) hr = IDirect3DViewport_Clear(viewport, 2, rect, D3DCLEAR_TARGET); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ color = get_surface_color(rt, 160, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + color = get_surface_color(rt, 160, 120); + ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + color = get_surface_color(rt, 480, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + color = get_surface_color(rt, 480, 120); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + + viewport_set_background(device, viewport, white); + hr = IDirect3DViewport_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + /* negative x, negative y. - * - * FIXME: WARP seems to clear the entire screen here.*/ + * Also ignored, except on WARP, which clears the entire screen.*/ rect_negneg.x1 = 640; rect_negneg.y1 = 240; rect_negneg.x2 = 320; @@ -10850,13 +10862,17 @@ static void test_clear(void) ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr);
color = get_surface_color(rt, 160, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 160, 120); - ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 120); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color);
/* Test how the viewport affects clears */ viewport_set_background(device, viewport, white); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 6a13764859..a3a71c7032 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -12216,9 +12216,21 @@ static void test_clear(void) hr = IDirect3DViewport2_Clear(viewport, 2, rect, D3DCLEAR_TARGET); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ color = get_surface_color(rt, 160, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + color = get_surface_color(rt, 160, 120); + ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + color = get_surface_color(rt, 480, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + color = get_surface_color(rt, 480, 120); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + + viewport_set_background(device, viewport, white); + hr = IDirect3DViewport2_Clear(viewport, 1, &rect_full, D3DCLEAR_TARGET); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + /* negative x, negative y. - * - * FIXME: WARP seems to clear the entire screen here.*/ + * Also ignored, except on WARP, which clears the entire screen.*/ rect_negneg.x1 = 640; rect_negneg.y1 = 240; rect_negneg.x2 = 320; @@ -12228,13 +12240,17 @@ static void test_clear(void) ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr);
color = get_surface_color(rt, 160, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 160, 120); - ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 120); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color);
/* Test how the viewport affects clears */ viewport_set_background(device, viewport, white); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b79e6c67a2..ee640c5632 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -14053,9 +14053,19 @@ static void test_clear(void) hr = IDirect3DViewport3_Clear2(viewport, 2, rect, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ color = get_surface_color(rt, 160, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + color = get_surface_color(rt, 160, 120); + ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + color = get_surface_color(rt, 480, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + color = get_surface_color(rt, 480, 120); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + + hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); /* negative x, negative y. - * - * FIXME: WARP seems to clear the entire screen here.*/ + * Also ignored, except on WARP, which clears the entire screen.*/ rect_negneg.x1 = 640; rect_negneg.y1 = 240; rect_negneg.x2 = 320; @@ -14064,13 +14074,17 @@ static void test_clear(void) ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr);
color = get_surface_color(rt, 160, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 160, 120); - ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 120); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color);
/* Test how the viewport affects clears */ hr = IDirect3DViewport3_Clear2(viewport, 1, &rect_full, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index ebcb972034..29ac1c209d 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -13428,9 +13428,19 @@ static void test_clear(void) hr = IDirect3DDevice7_Clear(device, 2, rect, D3DCLEAR_TARGET, 0xffff0000, 0.0, 0); ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr);
+ color = get_surface_color(rt, 160, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + color = get_surface_color(rt, 160, 120); + ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + color = get_surface_color(rt, 480, 360); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + color = get_surface_color(rt, 480, 120); + ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + + hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); /* negative x, negative y. - * - * FIXME: WARP seems to clear the entire screen here.*/ + * Also ignored, except on WARP, which clears the entire screen.*/ rect_negneg.x1 = 640; rect_negneg.y1 = 240; rect_negneg.x2 = 320; @@ -13439,13 +13449,17 @@ static void test_clear(void) ok(hr == D3D_OK, "Failed to clear, hr %#x.\n", hr);
color = get_surface_color(rt, 160, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 3(pos, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 160, 120); - ok(compare_color(color, 0x00ff0000, 0), "Clear rectangle 1(pos, pos) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 360); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(NULL) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color); color = get_surface_color(rt, 480, 120); - ok(compare_color(color, 0x00ffffff, 0), "Clear rectangle 4(neg, neg) has color %08x.\n", color); + ok(compare_color(color, 0x00ffffff, 0) || broken(compare_color(color, 0x0000ff00, 0)), + "Got unexpected color %08x.\n", color);
/* Test how the viewport affects clears */ hr = IDirect3DDevice7_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xffffffff, 0.0, 0);