From f3f25b14693b7211467ae39279b01c580ef8e5b4 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 12 Nov 2013 15:37:57 +0100 Subject: Avoid using GLX pbuffers on fglrx Task-number: QTBUG-34427 Change-Id: Ief4fe2fe2ab099d4ec61b6bfb2272724dfb2a800 Reviewed-by: Gunnar Sletta Reviewed-by: Sean Harmer --- src/plugins/platforms/xcb/qglxintegration.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src') 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 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); } -- cgit v1.2.3