winex11: Separately store the internal pixel format set by WGL_WINE_pixel_format_passthrough.

This commit is contained in:
Zebediah Figura 2023-01-20 16:23:42 -06:00 committed by Alexandre Julliard
parent c2018ff466
commit 46c8a63752
7 changed files with 29 additions and 33 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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 );
}