When any of these flags:
- PFD_DRAW_TO_WINDOW
- PFD_DRAW_TO_BITMAP
- PFD_SUPPORT_GDI
- PFD_SUPPORT_OPENGL
are set on the PIXELFORMATDESCRIPTOR parameter to ChoosePixelFormat(),
the returned pixel format must also have them set, but when they are
unset, the returned pixel format may or may not have them set.
Also add support for filtering on all these flags. In particular, the
lack of filtering on PFD_SUPPORT_GDI, was causing (at least) Java 1.3
to fail to initialize graphics, because we were returning a pixel
format without the PFD_SUPPORT_GDI flag it asked for.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=7767
--
v5: opengl32: Implement filtering on all the ChoosePixelFormat() flags that are ignored when unset
https://gitlab.winehq.org/wine/wine/-/merge_requests/3111
Java (1.3 at least) calls ChoosePixelFormat() with the PFD_SUPPORT_GDI flag set
and expects the returned PIXELFORMATDESCRIPTOR to have that flag set. If it
doesn't, an exception is thrown and it fails to initialize graphics. If no
PIXELFORMATDESCRIPTOR is returned instead, it falls back to an alternative
rendering method and proceeds further.
Therefore, when the PFD_SUPPORT_GDI flag is specified, treat it as a mandatory
requirement, and only return a PIXELFORMATDESCRIPTOR on which it is set, if
any.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=7767
Closes #7767
--
v4: opengl32: Implement filtering on all the ChoosePixelFormat() flags that are ignored when unset
https://gitlab.winehq.org/wine/wine/-/merge_requests/3111