diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 804dd6955de..7639e58808e 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7929,20 +7929,20 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); refcount = IDirect3DDevice8_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D8_Release(d3d8); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index e0f3fa45898..8ab52c7d5e4 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -11207,20 +11207,20 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %lu references left.\n", refcount); IDirect3D9_Release(d3d9); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 4f950d775b2..3e5bf3dee1a 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -6013,7 +6013,7 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -6039,7 +6039,7 @@ static void test_pixel_format(void) ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); IDirectDrawSurface_Release(offscreen); IDirectDrawSurface_Release(primary); @@ -6047,7 +6047,7 @@ static void test_pixel_format(void) ok(!refcount, "Got unexpected refcount %lu.\n", refcount); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 476531d41a5..6c07c9531f4 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -7138,7 +7138,7 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -7164,7 +7164,7 @@ static void test_pixel_format(void) ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); IDirectDrawSurface_Release(offscreen); IDirectDrawSurface_Release(primary); @@ -7172,7 +7172,7 @@ static void test_pixel_format(void) ok(!refcount, "Got unexpected refcount %lu.\n", refcount); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 71052214baf..943fbd36002 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -9021,7 +9021,7 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -9047,7 +9047,7 @@ static void test_pixel_format(void) ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); IDirectDrawSurface4_Release(offscreen); IDirectDrawSurface4_Release(primary); @@ -9055,7 +9055,7 @@ static void test_pixel_format(void) ok(!refcount, "Got unexpected refcount %lu.\n", refcount); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 8ac62b303e1..d875afcfa16 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8861,7 +8861,7 @@ static void test_pixel_format(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); memset(&ddsd, 0, sizeof(ddsd)); ddsd.dwSize = sizeof(ddsd); @@ -8887,7 +8887,7 @@ static void test_pixel_format(void) ok(SUCCEEDED(hr), "Failed to blit to primary surface, hr %#lx.\n", hr); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); IDirectDrawSurface7_Release(offscreen); IDirectDrawSurface7_Release(primary); @@ -8895,7 +8895,7 @@ static void test_pixel_format(void) ok(!refcount, "Got unexpected refcount %lu.\n", refcount); test_format = GetPixelFormat(hdc3); - todo_wine ok(!test_format, "Expected no format, got %d.\n", test_format); + ok(!test_format, "Expected no format, got %d.\n", test_format); ret = SetPixelFormat(hdc3, format, &pfd); ok(ret, "Failed to set pixel format %d.\n", format); diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 3006d1a2447..b2169de9bf7 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -1388,13 +1388,13 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel /*********************************************************************** * set_win_format */ -static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BOOL mutable_pf ) +static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BOOL internal ) { struct gl_drawable *gl; if (!format->visual) return FALSE; - if (!(gl = create_gl_drawable( hwnd, format, FALSE, mutable_pf ))) return FALSE; + if (!(gl = create_gl_drawable( hwnd, format, FALSE, internal ))) return FALSE; TRACE( "created GL drawable %lx for win %p %s\n", gl->drawable, hwnd, debugstr_fbconfig( format->fbconfig )); @@ -1402,12 +1402,12 @@ static BOOL set_win_format( HWND hwnd, const struct wgl_pixel_format *format, BO XFlush( gdi_display ); release_gl_drawable( gl ); - win32u_set_window_pixel_format( hwnd, pixel_format_index( format ), FALSE ); + win32u_set_window_pixel_format( hwnd, pixel_format_index( format ), internal ); return TRUE; } -static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change) +static BOOL set_pixel_format( HDC hdc, int format, BOOL internal ) { const struct wgl_pixel_format *fmt; int value; @@ -1435,20 +1435,16 @@ static BOOL set_pixel_format(HDC hdc, int format, BOOL allow_change) return FALSE; } - if (!allow_change) + if (!internal) { - struct gl_drawable *gl; - if ((gl = get_gl_drawable( hwnd, hdc ))) - { - int prev = pixel_format_index( gl->format ); - BOOL mutable_pf = gl->mutable_pf; - release_gl_drawable( gl ); - if (!mutable_pf) - return prev == format; /* cannot change it if already set */ - } + /* cannot change it if already set */ + int prev = win32u_get_window_pixel_format( hwnd ); + + if (prev) + return prev == format; } - return set_win_format( hwnd, fmt, allow_change ); + return set_win_format( hwnd, fmt, internal ); }