summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@digia.com>2013-11-12 15:37:57 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-14 21:15:35 +0100
commitf3f25b14693b7211467ae39279b01c580ef8e5b4 (patch)
tree5c94fe301abf22306f34b122a32ad797e91447df /src
parent9f75292a602ba22b1a3a46f8a161020d2f847565 (diff)
Avoid using GLX pbuffers on fglrx
Task-number: QTBUG-34427 Change-Id: Ief4fe2fe2ab099d4ec61b6bfb2272724dfb2a800 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/xcb/qglxintegration.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp
index d05de63c8f..e6fa8fc898 100644
--- a/src/plugins/platforms/xcb/qglxintegration.cpp
+++ b/src/plugins/platforms/xcb/qglxintegration.cpp
@@ -436,11 +436,23 @@ void QGLXContext::queryDummyContext()
if (oldContext)
oldSurface = oldContext->surface();
- QOffscreenSurface surface;
- surface.create();
+ QScopedPointer<QSurface> surface;
+ const char *vendor = glXGetClientString(glXGetCurrentDisplay(), GLX_VENDOR);
+ if (vendor && !strcmp(vendor, "ATI")) {
+ QWindow *window = new QWindow;
+ window->resize(64, 64);
+ window->setSurfaceType(QSurface::OpenGLSurface);
+ window->create();
+ surface.reset(window);
+ } else {
+ QOffscreenSurface *offSurface = new QOffscreenSurface;
+ offSurface->create();
+ surface.reset(offSurface);
+ }
+
QOpenGLContext context;
context.create();
- context.makeCurrent(&surface);
+ context.makeCurrent(surface.data());
const char *renderer = (const char *) glGetString(GL_RENDERER);
@@ -452,6 +464,7 @@ void QGLXContext::queryDummyContext()
}
}
+ context.doneCurrent();
if (oldContext && oldSurface)
oldContext->makeCurrent(oldSurface);
}