From 15ac2bc856735cdd81dde9f3d3dc2c47177ef814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Fri, 26 Mar 2010 10:05:16 +0100 Subject: Only use the texture_from_pixmap extension in the main thread. It's not possible to bind several texture ids to the same surface that wraps a native X11 Pixmap, which means we can't use it reliably from more than one thread at a time. For now we limit the usage to the main thread. --- src/opengl/qgl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index fa6dd37..995e753 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -2521,7 +2521,8 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, const QX11Info *xinfo = qt_x11Info(paintDevice); if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType && xinfo && xinfo->screen() == pixmap.x11Info().screen() - && target == GL_TEXTURE_2D) + && target == GL_TEXTURE_2D + && QApplication::instance()->thread() == QThread::currentThread()) { texture = bindTextureFromNativePixmap(const_cast(&pixmap), key, options); if (texture) { -- cgit v0.12