From e7fd798af001e2c4e323f5ae90e4e994f12ccf33 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 5 Nov 2013 09:32:35 +0100 Subject: [PATCH] Disable threaded rendering for Intel HD 3000 cards. Task-number: QTBUG-34492 Change-Id: I1848cde3fb9517679fd54a7170ed5bee40880edc Reviewed-by: Giuseppe D'Angelo --- src/plugins/platforms/xcb/qglxintegration.cpp | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 2c418cbebe..4ac4cf21ab 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -411,6 +411,16 @@ bool QGLXContext::isValid() const bool QGLXContext::m_queriedDummyContext = false; bool QGLXContext::m_supportsThreading = true; + +// If this list grows to any significant size, change it a +// proper string table and make the implementation below use +// binary search. +static const char *qglx_threadedgl_blacklist[] = { + "Chromium", // QTBUG-32225 (initialization fails) + "Mesa DRI Intel(R) Sandybridge Mobile", // QTBUG-34492 (flickering in fullscreen) + 0 +}; + void QGLXContext::queryDummyContext() { if (m_queriedDummyContext) @@ -428,10 +438,14 @@ void QGLXContext::queryDummyContext() context.makeCurrent(&surface); const char *renderer = (const char *) glGetString(GL_RENDERER); - if (QByteArray(renderer).contains("Chromium")) - m_supportsThreading = false; - else - m_supportsThreading = true; + + m_supportsThreading = true; + for (int i = 0; qglx_threadedgl_blacklist[i]; ++i) { + if (strstr(renderer, qglx_threadedgl_blacklist[i]) != 0) { + m_supportsThreading = false; + break; + } + } } bool QGLXContext::supportsThreading()