Don't support threaded GL on chromium (virtual box GL)
Change-Id: I84f89450e3fce1cbbafd19dbf4509b1911e06b19 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
This commit is contained in:
parent
cf239f69e1
commit
9087d4ed7b
@ -408,6 +408,38 @@ bool QGLXContext::isValid() const
|
|||||||
return m_context != 0;
|
return m_context != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool QGLXContext::m_queriedDummyContext = false;
|
||||||
|
bool QGLXContext::m_supportsThreading = true;
|
||||||
|
|
||||||
|
void QGLXContext::queryDummyContext()
|
||||||
|
{
|
||||||
|
if (m_queriedDummyContext)
|
||||||
|
return;
|
||||||
|
m_queriedDummyContext = true;
|
||||||
|
|
||||||
|
static bool skip = qEnvironmentVariableIsSet("QT_OPENGL_NO_SANITY_CHECK");
|
||||||
|
if (skip)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QOffscreenSurface surface;
|
||||||
|
surface.create();
|
||||||
|
QOpenGLContext context;
|
||||||
|
context.create();
|
||||||
|
context.makeCurrent(&surface);
|
||||||
|
|
||||||
|
const char *renderer = (const char *) glGetString(GL_RENDERER);
|
||||||
|
if (QByteArray(renderer).contains("Chromium"))
|
||||||
|
m_supportsThreading = false;
|
||||||
|
else
|
||||||
|
m_supportsThreading = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool QGLXContext::supportsThreading()
|
||||||
|
{
|
||||||
|
if (!m_queriedDummyContext)
|
||||||
|
queryDummyContext();
|
||||||
|
return m_supportsThreading;
|
||||||
|
}
|
||||||
|
|
||||||
QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface)
|
QGLXPbuffer::QGLXPbuffer(QOffscreenSurface *offscreenSurface)
|
||||||
: QPlatformOffscreenSurface(offscreenSurface)
|
: QPlatformOffscreenSurface(offscreenSurface)
|
||||||
|
@ -72,12 +72,18 @@ public:
|
|||||||
|
|
||||||
GLXContext glxContext() const { return m_context; }
|
GLXContext glxContext() const { return m_context; }
|
||||||
|
|
||||||
|
static bool supportsThreading();
|
||||||
|
static void queryDummyContext();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QXcbScreen *m_screen;
|
QXcbScreen *m_screen;
|
||||||
GLXContext m_context;
|
GLXContext m_context;
|
||||||
GLXContext m_shareContext;
|
GLXContext m_shareContext;
|
||||||
QSurfaceFormat m_format;
|
QSurfaceFormat m_format;
|
||||||
bool m_isPBufferCurrent;
|
bool m_isPBufferCurrent;
|
||||||
|
|
||||||
|
static bool m_queriedDummyContext;
|
||||||
|
static bool m_supportsThreading;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -278,7 +278,7 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
|||||||
#else
|
#else
|
||||||
case OpenGL: return false;
|
case OpenGL: return false;
|
||||||
#endif
|
#endif
|
||||||
case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering();
|
case ThreadedOpenGL: return m_connections.at(0)->supportsThreadedRendering() && QGLXContext::supportsThreading();
|
||||||
case WindowMasks: return true;
|
case WindowMasks: return true;
|
||||||
case MultipleWindows: return true;
|
case MultipleWindows: return true;
|
||||||
case ForeignWindows: return true;
|
case ForeignWindows: return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user