ddraw/tests: r200 ignores the alpha channel when matching color keys.

This commit is contained in:
Stefan Dösinger 2015-03-12 10:55:19 +01:00 committed by Alexandre Julliard
parent b003cefe9e
commit 5061e3502e
4 changed files with 80 additions and 56 deletions

View File

@ -1202,19 +1202,21 @@ static void test_ck_rgba(void)
D3DCOLOR fill_color; D3DCOLOR fill_color;
BOOL color_key; BOOL color_key;
BOOL blend; BOOL blend;
D3DCOLOR result1; D3DCOLOR result1, result1_broken;
D3DCOLOR result2; D3DCOLOR result2, result2_broken;
} }
tests[] = tests[] =
{ {
{0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x000000ff}, /* r200 on Windows doesn't check the alpha component when applying the color
{0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x000000ff}, * key, so the key matches on every texel. */
{0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00807f00}, {0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00}, {0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00ff0000, 0x00807f00, 0x000000ff},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x000000ff},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00, 0x00807f00, 0x00807f00},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
}; };
IDirect3DExecuteBuffer *execute_buffer; IDirect3DExecuteBuffer *execute_buffer;
@ -1328,10 +1330,12 @@ static void test_ck_rgba(void)
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
else else
ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
U5(fx).dwFillColor = 0xff0000ff; U5(fx).dwFillColor = 0xff0000ff;
@ -1350,10 +1354,12 @@ static void test_ck_rgba(void)
* discarded, instead of just fully transparent. */ * discarded, instead of just fully transparent. */
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
else else
ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
} }

View File

@ -1471,19 +1471,21 @@ static void test_ck_rgba(void)
D3DCOLOR fill_color; D3DCOLOR fill_color;
BOOL color_key; BOOL color_key;
BOOL blend; BOOL blend;
D3DCOLOR result1; D3DCOLOR result1, result1_broken;
D3DCOLOR result2; D3DCOLOR result2, result2_broken;
} }
tests[] = tests[] =
{ {
{0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x000000ff}, /* r200 on Windows doesn't check the alpha component when applying the color
{0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x000000ff}, * key, so the key matches on every texel. */
{0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00807f00}, {0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00}, {0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00ff0000, 0x00807f00, 0x000000ff},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x000000ff},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00, 0x00807f00, 0x00807f00},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
}; };
D3DTEXTUREHANDLE texture_handle; D3DTEXTUREHANDLE texture_handle;
@ -1576,10 +1578,12 @@ static void test_ck_rgba(void)
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
else else
ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
U5(fx).dwFillColor = 0xff0000ff; U5(fx).dwFillColor = 0xff0000ff;
@ -1597,10 +1601,12 @@ static void test_ck_rgba(void)
* discarded, instead of just fully transparent. */ * discarded, instead of just fully transparent. */
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
else else
ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
} }

View File

@ -1662,19 +1662,21 @@ static void test_ck_rgba(void)
D3DCOLOR fill_color; D3DCOLOR fill_color;
BOOL color_key; BOOL color_key;
BOOL blend; BOOL blend;
D3DCOLOR result1; D3DCOLOR result1, result1_broken;
D3DCOLOR result2; D3DCOLOR result2, result2_broken;
} }
tests[] = tests[] =
{ {
{0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x000000ff}, /* r200 on Windows doesn't check the alpha component when applying the color
{0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x000000ff}, * key, so the key matches on every texel. */
{0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00807f00}, {0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00}, {0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00ff0000, 0x00807f00, 0x000000ff},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x000000ff},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00, 0x00807f00, 0x00807f00},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
}; };
IDirectDrawSurface4 *surface; IDirectDrawSurface4 *surface;
@ -1765,10 +1767,12 @@ static void test_ck_rgba(void)
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
else else
ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
U5(fx).dwFillColor = 0xff0000ff; U5(fx).dwFillColor = 0xff0000ff;
@ -1786,10 +1790,12 @@ static void test_ck_rgba(void)
* discarded, instead of just fully transparent. */ * discarded, instead of just fully transparent. */
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
else else
ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
} }

View File

@ -1376,19 +1376,21 @@ static void test_ck_rgba(void)
D3DCOLOR fill_color; D3DCOLOR fill_color;
BOOL color_key; BOOL color_key;
BOOL blend; BOOL blend;
D3DCOLOR result1; D3DCOLOR result1, result1_broken;
D3DCOLOR result2; D3DCOLOR result2, result2_broken;
} }
tests[] = tests[] =
{ {
{0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x000000ff}, /* r200 on Windows doesn't check the alpha component when applying the color
{0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x000000ff}, * key, so the key matches on every texel. */
{0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, TRUE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, TRUE, FALSE, 0x00ff0000, 0x00ff0000, 0x000000ff, 0x000000ff},
{0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00807f00}, {0xff00ff00, FALSE, TRUE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x0000ff00}, {0xff00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00}, {0x7f00ff00, TRUE, TRUE, 0x00807f00, 0x00ff0000, 0x00807f00, 0x000000ff},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00}, {0x7f00ff00, TRUE, FALSE, 0x0000ff00, 0x00ff0000, 0x0000ff00, 0x000000ff},
{0x7f00ff00, FALSE, TRUE, 0x00807f00, 0x00807f00, 0x00807f00, 0x00807f00},
{0x7f00ff00, FALSE, FALSE, 0x0000ff00, 0x0000ff00, 0x0000ff00, 0x0000ff00},
}; };
IDirectDrawSurface7 *texture; IDirectDrawSurface7 *texture;
@ -1470,10 +1472,12 @@ static void test_ck_rgba(void)
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
else else
ok(compare_color(color, tests[i].result1, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result1, 1) || compare_color(color, tests[i].result1_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result1, i, color); tests[i].result1, i, color);
U5(fx).dwFillColor = 0xff0000ff; U5(fx).dwFillColor = 0xff0000ff;
@ -1491,10 +1495,12 @@ static void test_ck_rgba(void)
* discarded, instead of just fully transparent. */ * discarded, instead of just fully transparent. */
color = get_surface_color(rt, 320, 240); color = get_surface_color(rt, 320, 240);
if (i == 2) if (i == 2)
todo_wine ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", todo_wine ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
else else
ok(compare_color(color, tests[i].result2, 1), "Expected color 0x%08x for test %u, got 0x%08x.\n", ok(compare_color(color, tests[i].result2, 1) || compare_color(color, tests[i].result2_broken, 1),
"Expected color 0x%08x for test %u, got 0x%08x.\n",
tests[i].result2, i, color); tests[i].result2, i, color);
} }