Skip to content

egl/x11, egl/xcb: create window with X visual from EGL config

Jeffrey Knockel requested to merge jeffk/vlc:egl-match-config into master

Note that this is an alternative approach to !4779 (closed) based on feedback.

On X, an EGL config is associated with an X visual, and its visual needs to match that of the output window, else your rendering may look like this instead of this. Prior to this merge request we unconditionally created an X window with the visual of its screen's root window, regardless of the visual we get from the config we chose from eglChooseConfig(). Due to the way that configs are sorted (by color depth), the first EGL config often matches the visual of our window and so this usually worked. However, as one counterexample, some X servers offer visuals with higher color depth than the root window. On such servers, the first EGL config won't match our window's visual and the resulting picture will be misrendered.

This merge request creates the window using the visual associated with the EGL config. Note that this merge request can be thought of as the opposite of !4779 (closed). In !4779 (closed), we chose an EGL config based on our window's visual. However, in this merge request we choose the window's visual based on our EGL config.

Merge request reports