The check was dropped in e392e0ac2846edc25610723c19d6a796372017e1, leaving the dwFlags variable unused.
I have no idea if it was indeed unnecessary or if it was dropped by mistake but either we need to keep the check, or we should remove the variable.
-- v2: winex11: Check pixel format flags in X11DRV_wglChoosePixelFormatARB. opengl32/tests: Test wglChoosePixelFormatARB flags filters.
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/opengl32/tests/opengl.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 57be207b548..3b49f8d2149 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -1821,6 +1821,13 @@ static void test_wglChoosePixelFormatARB(HDC hdc) WGL_SUPPORT_OPENGL_ARB, 1, 0 }; + static int attrib_list_flags[] = + { + WGL_DRAW_TO_WINDOW_ARB, 1, + WGL_SUPPORT_OPENGL_ARB, 1, + WGL_SUPPORT_GDI_ARB, 1, + 0 + };
PIXELFORMATDESCRIPTOR fmt, last_fmt; BYTE depth, last_depth; @@ -1867,6 +1874,27 @@ static void test_wglChoosePixelFormatARB(HDC hdc) depth, last_depth, i, formats[i]); } } + + format_count = 0; + res = pwglChoosePixelFormatARB(hdc, attrib_list_flags, NULL, ARRAY_SIZE(formats), formats, &format_count); + ok(res, "Got unexpected result %d.\n", res); + + for (i = 0; i < format_count; ++i) + { + PIXELFORMATDESCRIPTOR format = {0}; + BOOL ret; + + winetest_push_context("%u", i); + + ret = DescribePixelFormat(hdc, formats[i], sizeof(format), &format); + ok(ret, "DescribePixelFormat failed, error %lu\n", GetLastError()); + + ok(format.dwFlags & PFD_DRAW_TO_WINDOW, "got dwFlags %#lx\n", format.dwFlags); + ok(format.dwFlags & PFD_SUPPORT_OPENGL, "got dwFlags %#lx\n", format.dwFlags); + todo_wine ok(format.dwFlags & PFD_SUPPORT_GDI, "got dwFlags %#lx\n", format.dwFlags); + + winetest_pop_context(); + } }
static void test_copy_context(HDC hdc)
From: Rémi Bernon rbernon@codeweavers.com
The check was dropped in e392e0ac2846edc25610723c19d6a796372017e1, leaving the dwFlags variable unused. --- dlls/opengl32/tests/opengl.c | 2 +- dlls/winex11.drv/opengl.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c index 3b49f8d2149..42c2626a2c2 100644 --- a/dlls/opengl32/tests/opengl.c +++ b/dlls/opengl32/tests/opengl.c @@ -1891,7 +1891,7 @@ static void test_wglChoosePixelFormatARB(HDC hdc)
ok(format.dwFlags & PFD_DRAW_TO_WINDOW, "got dwFlags %#lx\n", format.dwFlags); ok(format.dwFlags & PFD_SUPPORT_OPENGL, "got dwFlags %#lx\n", format.dwFlags); - todo_wine ok(format.dwFlags & PFD_SUPPORT_GDI, "got dwFlags %#lx\n", format.dwFlags); + ok(format.dwFlags & PFD_SUPPORT_GDI, "got dwFlags %#lx\n", format.dwFlags);
winetest_pop_context(); } diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c index 52f363461e4..96a8526604b 100644 --- a/dlls/winex11.drv/opengl.c +++ b/dlls/winex11.drv/opengl.c @@ -2638,6 +2638,8 @@ static BOOL X11DRV_wglChoosePixelFormatARB( HDC hdc, const int *piAttribIList, c
if (i == nb_pixel_formats) continue; + if ((pixel_formats[i].dwFlags & dwFlags) != dwFlags) + continue;
format = &formats[format_count]; format->format = i + 1;
This merge request was approved by Paul Gofman.