From 722be68169339d96639d2ef9c765fff726123c9f Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Thu, 21 Aug 2014 11:56:33 +0200 Subject: 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 --- src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp') diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp index 071686c70..ac1185f13 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) -- cgit v1.2.3