diff options
author | Andras Becsi <andras.becsi@digia.com> | 2014-07-07 13:28:21 +0200 |
---|---|---|
committer | Andras Becsi <andras.becsi@digia.com> | 2014-07-07 16:18:24 +0200 |
commit | 16baadab11341e671150932fd28cff466a4fc041 (patch) | |
tree | cef621459f4c1b59a345da0434a7b376dda363de /src/plugins/platforms/xcb/qxcbnativeinterface.cpp | |
parent | 56ce6ba9792778e7d6fa1194b41e282633ff81c1 (diff) |
Add support for querying "glxconfig" from native interface
This makes it possible to retrieve the GLXFBConfig used by Qt to
create the GLXContext. QtWebEngine on desktop needs this so that
Chromium can use the same config as Qt to eliminate BadMatch errors.
Change-Id: If18c0937b5af3e457ddbfda035e5d652230211c6
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbnativeinterface.cpp')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbnativeinterface.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp index 490064a94d..b381fac5bb 100644 --- a/src/plugins/platforms/xcb/qxcbnativeinterface.cpp +++ b/src/plugins/platforms/xcb/qxcbnativeinterface.cpp @@ -79,6 +79,7 @@ static int resourceType(const QByteArray &key) QByteArrayLiteral("display"), QByteArrayLiteral("egldisplay"), QByteArrayLiteral("connection"), QByteArrayLiteral("screen"), QByteArrayLiteral("eglcontext"), + QByteArrayLiteral("glxconfig"), QByteArrayLiteral("glxcontext"), QByteArrayLiteral("apptime"), QByteArrayLiteral("appusertime"), QByteArrayLiteral("hintstyle"), QByteArrayLiteral("startupid"), QByteArrayLiteral("traywindow"), @@ -240,6 +241,9 @@ void *QXcbNativeInterface::nativeResourceForContext(const QByteArray &resourceSt case EglContext: result = eglContextForContext(context); break; + case GLXConfig: + result = glxConfigForContext(context); + break; case GLXContext: result = glxContextForContext(context); break; @@ -471,4 +475,17 @@ void *QXcbNativeInterface::glxContextForContext(QOpenGLContext *context) } +void *QXcbNativeInterface::glxConfigForContext(QOpenGLContext *context) +{ + Q_ASSERT(context); +#if defined(XCB_USE_GLX) + QGLXContext *glxPlatformContext = static_cast<QGLXContext *>(context->handle()); + return glxPlatformContext->glxConfig(); +#else + Q_UNUSED(context); + return 0; +#endif + +} + QT_END_NAMESPACE |