ddraw/tests: Don't COLORFILL a surface with a clipper.

The r500 driver on Windows 10 fails the call with DDERR_EXCEPTION. I believe
this problem is new on Windows 10, I don't remember seeing it on Win7 on the
same hardware. It is probably a side effect of running Win10 with the Win7
driver.

Signed-off-by: Stefan Dösinger <stefan@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Stefan Dösinger 2020-01-23 10:45:42 +01:00 committed by Alexandre Julliard
parent b6904bb618
commit a86798200a
4 changed files with 74 additions and 10 deletions

View File

@ -5233,7 +5233,7 @@ static void test_pixel_format(void)
IDirectDraw *ddraw = NULL;
IDirectDrawClipper *clipper = NULL;
DDSURFACEDESC ddsd;
IDirectDrawSurface *primary = NULL;
IDirectDrawSurface *primary = NULL, *offscreen;
DDBLTFX fx;
HRESULT hr;
@ -5352,20 +5352,36 @@ static void test_pixel_format(void)
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = ddsd.dwHeight = 64;
hr = IDirectDraw_CreateSurface(ddraw, &ddsd, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
hr = IDirectDrawSurface_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
hr = IDirectDrawSurface_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirectDrawSurface_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
IDirectDrawSurface_Release(offscreen);
cleanup:
if (primary) IDirectDrawSurface_Release(primary);
if (clipper) IDirectDrawClipper_Release(clipper);

View File

@ -6178,7 +6178,7 @@ static void test_pixel_format(void)
IDirectDraw2 *ddraw = NULL;
IDirectDrawClipper *clipper = NULL;
DDSURFACEDESC ddsd;
IDirectDrawSurface *primary = NULL;
IDirectDrawSurface *primary = NULL, *offscreen;
DDBLTFX fx;
HRESULT hr;
@ -6287,7 +6287,7 @@ static void test_pixel_format(void)
if (clipper)
{
hr = IDirectDrawSurface2_SetClipper(primary, clipper);
hr = IDirectDrawSurface_SetClipper(primary, clipper);
ok(SUCCEEDED(hr), "Failed to set clipper, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
@ -6297,22 +6297,38 @@ static void test_pixel_format(void)
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = ddsd.dwHeight = 64;
hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
hr = IDirectDrawSurface2_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
hr = IDirectDrawSurface_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirectDrawSurface_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
IDirectDrawSurface_Release(offscreen);
cleanup:
if (primary) IDirectDrawSurface2_Release(primary);
if (primary) IDirectDrawSurface_Release(primary);
if (clipper) IDirectDrawClipper_Release(clipper);
if (ddraw) IDirectDraw2_Release(ddraw);
if (gl) FreeLibrary(gl);

View File

@ -7994,7 +7994,7 @@ static void test_pixel_format(void)
IDirectDraw4 *ddraw = NULL;
IDirectDrawClipper *clipper = NULL;
DDSURFACEDESC2 ddsd;
IDirectDrawSurface4 *primary = NULL;
IDirectDrawSurface4 *primary = NULL, *offscreen;
DDBLTFX fx;
HRESULT hr;
@ -8113,20 +8113,36 @@ static void test_pixel_format(void)
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = ddsd.dwHeight = 64;
hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
hr = IDirectDrawSurface4_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
hr = IDirectDrawSurface4_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirectDrawSurface4_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
IDirectDrawSurface4_Release(offscreen);
cleanup:
if (primary) IDirectDrawSurface4_Release(primary);
if (clipper) IDirectDrawClipper_Release(clipper);

View File

@ -7836,7 +7836,7 @@ static void test_pixel_format(void)
IDirectDraw7 *ddraw = NULL;
IDirectDrawClipper *clipper = NULL;
DDSURFACEDESC2 ddsd;
IDirectDrawSurface7 *primary = NULL;
IDirectDrawSurface7 *primary = NULL, *offscreen;
DDBLTFX fx;
HRESULT hr;
@ -7955,20 +7955,36 @@ static void test_pixel_format(void)
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
memset(&ddsd, 0, sizeof(ddsd));
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT;
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN;
ddsd.dwWidth = ddsd.dwHeight = 64;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &offscreen, NULL);
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x.\n",hr);
memset(&fx, 0, sizeof(fx));
fx.dwSize = sizeof(fx);
hr = IDirectDrawSurface7_Blt(primary, NULL, NULL, NULL, DDBLT_COLORFILL | DDBLT_WAIT, &fx);
hr = IDirectDrawSurface7_Blt(offscreen, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx);
ok(SUCCEEDED(hr), "Failed to clear source surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
hr = IDirectDrawSurface7_Blt(primary, NULL, offscreen, NULL, DDBLT_WAIT, NULL);
ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#x.\n", hr);
test_format = GetPixelFormat(hdc);
ok(test_format == format, "window has pixel format %d, expected %d\n", test_format, format);
if (hdc2)
{
test_format = GetPixelFormat(hdc2);
ok(test_format == format, "second window has pixel format %d, expected %d\n", test_format, format);
}
IDirectDrawSurface7_Release(offscreen);
cleanup:
if (primary) IDirectDrawSurface7_Release(primary);
if (clipper) IDirectDrawClipper_Release(clipper);