diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 61f0adcd7ef..ca64d3e6c88 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -5869,6 +5869,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -5882,14 +5887,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } } - memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -5898,7 +5904,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 6e35bfd534b..7dfb35d2d3a 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -6824,6 +6824,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -6837,14 +6842,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } } - memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface7_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -6853,7 +6859,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b53c0c2160e..e1d5bac18bb 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -8650,6 +8650,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface4_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface4_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface4_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface4_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -8663,14 +8668,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); x++) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } } - memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface4_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -8679,7 +8685,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface4_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8ccfbd4cd8a..3ad44991863 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8509,6 +8509,11 @@ static void test_p8_blit(void) hr = IDirectDrawSurface7_Unlock(dst_p8, NULL); ok(SUCCEEDED(hr), "Failed to unlock destination surface, hr %#x.\n", hr); + fx.dwSize = sizeof(fx); + fx.dwFillColor = 0xdeadbeef; + hr = IDirectDrawSurface7_Blt(dst, NULL, NULL, NULL, DDBLT_WAIT | DDBLT_COLORFILL, &fx); + ok(SUCCEEDED(hr), "Failed to color fill %#x.\n", hr); + hr = IDirectDrawSurface7_SetPalette(src, palette); ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr); hr = IDirectDrawSurface7_Blt(dst, NULL, src, NULL, DDBLT_WAIT, NULL); @@ -8522,14 +8527,15 @@ static void test_p8_blit(void) for (x = 0; x < ARRAY_SIZE(expected); ++x) { color = get_surface_color(dst, x, 0); - todo_wine ok(compare_color(color, expected[x], 0), + /* WARP on 1709 and newer write zeroes on non-colorkeyed P8 -> RGB blits. For ckey + * blits see below. */ + todo_wine ok(compare_color(color, expected[x], 0) + || broken(is_warp && compare_color(color, 0x00000000, 0)), "Pixel %u: Got color %#x, expected %#x.\n", x, color, expected[x]); } } - memset(&fx, 0, sizeof(fx)); - fx.dwSize = sizeof(fx); fx.ddckSrcColorkey.dwColorSpaceHighValue = 0x2; fx.ddckSrcColorkey.dwColorSpaceLowValue = 0x2; hr = IDirectDrawSurface7_Blt(dst_p8, NULL, src, NULL, DDBLT_WAIT | DDBLT_KEYSRCOVERRIDE, &fx); @@ -8538,7 +8544,7 @@ static void test_p8_blit(void) hr = IDirectDrawSurface7_Lock(dst_p8, NULL, &surface_desc, DDLOCK_READONLY | DDLOCK_WAIT, NULL); ok(SUCCEEDED(hr), "Failed to lock destination surface, hr %#x.\n", hr); /* A color keyed P8 blit doesn't do anything on WARP - it just leaves the data in the destination - * surface untouched. P8 blits without color keys work. Error checking (DDBLT_KEYSRC without a key + * surface untouched. Error checking (DDBLT_KEYSRC without a key * for example) also works as expected. * * Using DDBLT_KEYSRC instead of DDBLT_KEYSRCOVERRIDE doesn't change this. Doing this blit with