From: Zebediah Figura zfigura@codeweavers.com
--- dlls/d3d8/tests/device.c | 6 +++--- dlls/d3d9/tests/device.c | 6 +++--- dlls/ddraw/tests/ddraw1.c | 6 +++--- dlls/ddraw/tests/ddraw2.c | 6 +++--- dlls/ddraw/tests/ddraw4.c | 6 +++--- dlls/ddraw/tests/ddraw7.c | 6 +++--- dlls/winex11.drv/opengl.c | 26 +++++++++++--------------- 7 files changed, 29 insertions(+), 33 deletions(-)
diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index c8f52484054..cebf462804d 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -7916,20 +7916,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 0e361b3ac23..6a0fe586f53 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -11191,20 +11191,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 71c60db3804..b52ea9ef4c3 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 eddf846e54b..9384072689b 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -7110,7 +7110,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); @@ -7136,7 +7136,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); @@ -7144,7 +7144,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 a658de37b94..df3dba2ccb4 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -8993,7 +8993,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); @@ -9019,7 +9019,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); @@ -9027,7 +9027,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 a1c791a9116..4dc98a3d2f2 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -8833,7 +8833,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); @@ -8859,7 +8859,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); @@ -8867,7 +8867,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 ); }