summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-02-12 10:49:50 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-02-12 10:49:50 (GMT)
commit8e309899b8287b67905072927df1e00effc2a13e (patch)
tree6c7bff1a77090c5b39b35a13c88ef876c2535e09 /src/opengl/qgl.cpp
parentf74029e286e97067ac39086955481bf979af69dc (diff)
parent01245bcabf97dfdfdd23a2ec075b8de3e78bdeb2 (diff)
downloadQt-8e309899b8287b67905072927df1e00effc2a13e.zip
Qt-8e309899b8287b67905072927df1e00effc2a13e.tar.gz
Qt-8e309899b8287b67905072927df1e00effc2a13e.tar.bz2
Merge remote branch 'origin/4.6' into qt-master-from-4.6
Diffstat (limited to 'src/opengl/qgl.cpp')
-rw-r--r--src/opengl/qgl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index 3e5c4fc..cfcbbf8 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -99,6 +99,10 @@ QT_BEGIN_NAMESPACE
QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs;
#endif
+#ifdef Q_WS_X11
+extern const QX11Info *qt_x11Info(const QPaintDevice *pd);
+#endif
+
struct QGLThreadContext {
QGLContext *context;
};
@@ -2448,7 +2452,10 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target,
#if defined(Q_WS_X11)
// Try to use texture_from_pixmap
- if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType) {
+ const QX11Info *xinfo = qt_x11Info(paintDevice);
+ if (pd->classId() == QPixmapData::X11Class && pd->pixelType() == QPixmapData::PixmapType
+ && xinfo && xinfo->screen() == pixmap.x11Info().screen())
+ {
texture = bindTextureFromNativePixmap(pd, key, options);
if (texture) {
texture->options |= QGLContext::MemoryManagedBindOption;