diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-21 11:56:33 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-08-21 12:30:55 +0200 |
commit | 722be68169339d96639d2ef9c765fff726123c9f (patch) | |
tree | 6c986b20bb287f52b0144934ee7a16bf804de0f0 | |
parent | 86a8f111de04720566925496bc7c82c6f069f56d (diff) | |
download | qtwayland-722be68169339d96639d2ef9c765fff726123c9f.tar.gz |
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 <robin.burchell@viroteck.net>
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp | 2 | ||||
-rw-r--r-- | src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp index 7cdbdf89..527ac868 100644 --- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp +++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp @@ -59,7 +59,7 @@ QWaylandEglWindow::QWaylandEglWindow(QWindow *window) , m_clientBufferIntegration(static_cast<QWaylandEglClientBufferIntegration *>(mDisplay->clientBufferIntegration())) , m_waylandEglWindow(0) , m_eglSurface(0) - , m_eglConfig(q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window->requestedFormat(), true)) + , m_eglConfig(q_configFromGLFormat(m_clientBufferIntegration->eglDisplay(), window->requestedFormat())) , m_contentFBO(0) , m_resize(false) , m_format(q_glFormatFromConfig(m_clientBufferIntegration->eglDisplay(), m_eglConfig)) 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) |