summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-20 08:34:47 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-01-20 08:36:41 (GMT)
commit092cfe31463146c17f99543e36cdd7da85961afc (patch)
treeb9b0fe06a8c8f1415100b5ed0db0fbbe5e3fc6a7 /src
parent2c86259f7422531c234faac1d1abbde603228195 (diff)
downloadQt-092cfe31463146c17f99543e36cdd7da85961afc.zip
Qt-092cfe31463146c17f99543e36cdd7da85961afc.tar.gz
Qt-092cfe31463146c17f99543e36cdd7da85961afc.tar.bz2
Fixed a crash under X11 when drawing QPixmaps to QGLPixelBuffers.
Task-number: QTBUG-7476 Reviewed-by: Kim
Diffstat (limited to 'src')
-rw-r--r--src/opengl/qgl_x11.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp
index f4cc7c7..61a16be 100644
--- a/src/opengl/qgl_x11.cpp
+++ b/src/opengl/qgl_x11.cpp
@@ -1651,8 +1651,12 @@ static bool qt_resolveTextureFromPixmap(QPaintDevice *paintDevice)
{
return false; // Can't use TFP without NPOT
}
+
const QX11Info *xinfo = qt_x11Info(paintDevice);
- QGLExtensionMatcher extensions(glXQueryExtensionsString(xinfo->display(), xinfo->screen()));
+ Display *display = xinfo ? xinfo->display() : X11->display;
+ int screen = xinfo ? xinfo->screen() : X11->defaultScreen;
+
+ QGLExtensionMatcher extensions(glXQueryExtensionsString(display, screen));
if (extensions.match("GLX_EXT_texture_from_pixmap")) {
glXBindTexImageEXT = (qt_glXBindTexImageEXT) qglx_getProcAddress("glXBindTexImageEXT");
glXReleaseTexImageEXT = (qt_glXReleaseTexImageEXT) qglx_getProcAddress("glXReleaseTexImageEXT");