path: root/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
diff options
authorLaszlo Agocs <>2014-08-21 11:56:33 +0200
committerLaszlo Agocs <>2014-08-21 12:30:55 +0200
commit722be68169339d96639d2ef9c765fff726123c9f (patch)
tree6c986b20bb287f52b0144934ee7a16bf804de0f0 /src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
parent86a8f111de04720566925496bc7c82c6f069f56d (diff)
Do not request the highest color buffer size
That third parameter is dangerous and should never be set to true, unless you know what you are doing. eglfs does not set this flag either. Do the same in wayland-egl, otherwise certain context/window creation patterns (in particular with QOffscrenSurface, which is often created with an existing context's format()) will end up with incompatible contexts and surfaces on systems that offer both 565 and 888 configs. Long story short, setting the flag ignores the extra check in the EGL config selection logic that ensures that you get a config you asked for, i.e. that a 888 config will not be returned (unless there is no other choice) if 565 was explicitly requested in the input QSurfaceFormat. The result is that we may get a 888 config even when explicitly asking for 565. However asking for unspecified will give 565. In the QOffscreenSurface case this means having an 565 context and a 888 window -> bad match. Not setting the flag brings the expected behavior: not specifying the color buffer sizes chooses the lower buffer size (565), explicitly specifying 565 chooses 565, while explicitly specifying 888 prioritizes 888 configs. Change-Id: Ia78086a9f255f2933cda7de4f5787d71d58a1356 Reviewed-by: Robin Burchell <>
Diffstat (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 071686c7..ac1185f1 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE
QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, const QSurfaceFormat &format, QPlatformOpenGLContext *share)
: QPlatformOpenGLContext()
, m_eglDisplay(eglDisplay)
- , m_config(q_configFromGLFormat(m_eglDisplay, format, true))
+ , m_config(q_configFromGLFormat(m_eglDisplay, format))
, m_format(q_glFormatFromConfig(m_eglDisplay, m_config))
, m_blitProgram(0)
, mUseNativeDefaultFbo(false)