summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-03-26 09:05:16 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-07-02 10:24:51 (GMT)
commit15ac2bc856735cdd81dde9f3d3dc2c47177ef814 (patch)
tree6abf0ab810594c800cdd65beb3f50fb2900e34ae /src/opengl
parent38922774119817f4bf1595b9651f914e5c3d9f02 (diff)
downloadQt-15ac2bc856735cdd81dde9f3d3dc2c47177ef814.zip
Qt-15ac2bc856735cdd81dde9f3d3dc2c47177ef814.tar.gz
Qt-15ac2bc856735cdd81dde9f3d3dc2c47177ef814.tar.bz2
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.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qgl.cpp3
1 files changed, 2 insertions, 1 deletions
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<QPixmap*>(&pixmap), key, options);
if (texture) {