diff options
author | Fredrik Höglund <fredrik@kde.org> | 2013-02-04 15:59:22 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-02-23 00:29:13 +0100 |
commit | 4b54c553058f278cedf1d40edacdc488aaa54f81 (patch) | |
tree | e413d47a54c41a5b754e337a1ca71b0e98adc2b6 /src/plugins/platforms/xcb/qxcbintegration.cpp | |
parent | 1b08e0307dfebe561fbb0819a2d6b53edd8e8e93 (diff) |
Fix OpenGL context creation in the XCB plugin
Make it possible to create a core context with OpenGL implementations
that don't implement the compatibility profile or the
GL_ARB_compatibility extension.
Qt was effectively clamping the OpenGL version to 3.0 by assuming that
the highest supported backwards compatible version is also the
highest supported core version.
Since there is no way to check if the implementation supports a
context with a given set of attributes without trying to create the
context, we have to try every known OpenGL version until we find one
that's supported.
Note that this commit does not fix similar breakage on other platforms.
Change-Id: I9616762b059db9e6182f853ab7f24ff44dc7d529
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbintegration.cpp | 29 |
1 files changed, 1 insertions, 28 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 1840dd1ce5..60acf1ff02 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -121,9 +121,6 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters) QXcbIntegration::~QXcbIntegration() { -#if !defined(QT_NO_OPENGL) && defined(XCB_USE_GLX) - qDeleteAll(m_defaultContextInfos); -#endif qDeleteAll(m_connections); } @@ -181,14 +178,7 @@ QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLCont { QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle()); #if defined(XCB_USE_GLX) - QOpenGLDefaultContextInfo *defaultContextInfo; - if (m_defaultContextInfos.contains(screen)) { - defaultContextInfo = m_defaultContextInfos.value(screen); - } else { - defaultContextInfo = QOpenGLDefaultContextInfo::create(screen); - m_defaultContextInfos.insert(screen, defaultContextInfo); - } - return new QGLXContext(screen, context->format(), context->shareHandle(), defaultContextInfo); + return new QGLXContext(screen, context->format(), context->shareHandle()); #elif defined(XCB_USE_EGL) return new QEGLXcbPlatformContext(context->format(), context->shareHandle(), screen->connection()->egl_display(), screen->connection()); @@ -293,21 +283,4 @@ QPlatformTheme *QXcbIntegration::createPlatformTheme(const QString &name) const return QGenericUnixTheme::createUnixTheme(name); } -/*! - Called by QXcbConnection prior to a QQnxScreen being deleted. - - Destroys and cleans up any default OpenGL context info for this screen. -*/ -void QXcbIntegration::removeDefaultOpenGLContextInfo(QXcbScreen *screen) -{ -#if !defined(QT_NO_OPENGL) && defined(XCB_USE_GLX) - if (!m_defaultContextInfos.contains(screen)) - return; - QOpenGLDefaultContextInfo* info = m_defaultContextInfos.take(screen); - delete info; -#else - Q_UNUSED(screen); -#endif -} - QT_END_NAMESPACE |