summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2014-02-18 14:11:34 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-21 15:53:41 +0100
commit3c50119625fec9c0a1e6d056f6f7e9f59e730c36 (patch)
tree18e41801f600846daae624e2c6b6fc42def2ad30 /src/plugins/platforms/xcb/qxcbintegration.cpp
parent1e413e01e06fcd3ca750dea799cb053801b96c3c (diff)
Avoid using GLX Pbuffers on Catalyst
Trigger QOffscreenSurface's fallback mode (hidden QWindow and a regular window surface) instead. queryDummyContext() already works like this but the same must be done for any QOffscreenSurface. Task-number: QTBUG-36900 Change-Id: I64176ac6704e9d6ed768fa3d456c40c8818be6dc Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 768a591ab5..aaa2e81c40 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -253,7 +253,18 @@ QPlatformBackingStore *QXcbIntegration::createPlatformBackingStore(QWindow *wind
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
#if defined(XCB_USE_GLX)
- return new QGLXPbuffer(surface);
+ static bool vendorChecked = false;
+ static bool glxPbufferUsable = true;
+ if (!vendorChecked) {
+ vendorChecked = true;
+ const char *glxvendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR);
+ if (glxvendor && !strcmp(glxvendor, "ATI"))
+ glxPbufferUsable = false;
+ }
+ if (glxPbufferUsable)
+ return new QGLXPbuffer(surface);
+ else
+ return 0; // trigger fallback to hidden QWindow
#elif defined(XCB_USE_EGL)
QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());
return new QEGLPbuffer(screen->connection()->egl_display(), surface->requestedFormat(), surface);