Commit 54481679 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Don't update the color table on palette changes.

parent 3cd83f4d
...@@ -5126,7 +5126,7 @@ static void test_palette_gdi(void) ...@@ -5126,7 +5126,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
...@@ -5139,7 +5139,7 @@ static void test_palette_gdi(void) ...@@ -5139,7 +5139,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
......
...@@ -6194,7 +6194,7 @@ static void test_palette_gdi(void) ...@@ -6194,7 +6194,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
...@@ -6207,7 +6207,7 @@ static void test_palette_gdi(void) ...@@ -6207,7 +6207,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
......
...@@ -7096,7 +7096,7 @@ static void test_palette_gdi(void) ...@@ -7096,7 +7096,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
...@@ -7109,7 +7109,7 @@ static void test_palette_gdi(void) ...@@ -7109,7 +7109,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
......
...@@ -6818,7 +6818,7 @@ static void test_palette_gdi(void) ...@@ -6818,7 +6818,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
...@@ -6831,7 +6831,7 @@ static void test_palette_gdi(void) ...@@ -6831,7 +6831,7 @@ static void test_palette_gdi(void)
i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]); i = GetDIBColorTable(dc, 4, 1, &rgbquad[4]);
ok(i == 1, "Expected count 1, got %u.\n", i); ok(i == 1, "Expected count 1, got %u.\n", i);
todo_wine ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])), ok(!memcmp(&rgbquad[4], &expected1[4], sizeof(rgbquad[4])),
"Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n", "Got color table entry %u r=%#x g=%#x b=%#x, expected r=%#x g=%#x b=%#x.\n",
i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue, i, rgbquad[4].rgbRed, rgbquad[4].rgbGreen, rgbquad[4].rgbBlue,
expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue); expected1[4].rgbRed, expected1[4].rgbGreen, expected1[4].rgbBlue);
......
...@@ -787,12 +787,6 @@ static void surface_realize_palette(struct wined3d_surface *surface) ...@@ -787,12 +787,6 @@ static void surface_realize_palette(struct wined3d_surface *surface)
} }
} }
if (surface->flags & SFLAG_DIBSECTION)
{
TRACE("Updating the DC's palette.\n");
SetDIBColorTable(surface->hDC, 0, 256, palette->colors);
}
/* Propagate the changes to the drawable when we have a palette. */ /* Propagate the changes to the drawable when we have a palette. */
if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET) if (surface->resource.usage & WINED3DUSAGE_RENDERTARGET)
surface_load_location(surface, surface->draw_binding); surface_load_location(surface, surface->draw_binding);
...@@ -1379,17 +1373,14 @@ static void gdi_surface_realize_palette(struct wined3d_surface *surface) ...@@ -1379,17 +1373,14 @@ static void gdi_surface_realize_palette(struct wined3d_surface *surface)
if (!palette) return; if (!palette) return;
if (surface->flags & SFLAG_DIBSECTION)
{
TRACE("Updating the DC's palette.\n");
SetDIBColorTable(surface->hDC, 0, 256, palette->colors);
}
/* Update the image because of the palette change. Some games like e.g. /* Update the image because of the palette change. Some games like e.g.
* Red Alert call SetEntries a lot to implement fading. */ * Red Alert call SetEntries a lot to implement fading. */
/* Tell the swapchain to update the screen. */ /* Tell the swapchain to update the screen. */
if (surface->swapchain && surface == surface->swapchain->front_buffer) if (surface->swapchain && surface == surface->swapchain->front_buffer)
{
SetDIBColorTable(surface->hDC, 0, 256, palette->colors);
x11_copy_to_screen(surface->swapchain, NULL); x11_copy_to_screen(surface->swapchain, NULL);
}
} }
static void gdi_surface_unmap(struct wined3d_surface *surface) static void gdi_surface_unmap(struct wined3d_surface *surface)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment