summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-02-10 13:19:08 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-02-10 13:19:08 (GMT)
commit0d27306664188a61571d31a38fec1d9040aae5f6 (patch)
treeeebc104c57878b09beb52c8c0a504b2e066b265b /src/opengl/qgl.cpp
parent0d1e1f26cd9c29e960117e23c57a84055f1cc9e1 (diff)
downloadQt-0d27306664188a61571d31a38fec1d9040aae5f6.zip
Qt-0d27306664188a61571d31a38fec1d9040aae5f6.tar.gz
Qt-0d27306664188a61571d31a38fec1d9040aae5f6.tar.bz2
Fixed drawing QPixmaps on QGLWidgets on different X11 screens.
Don't try to use the texture_from_pixmap extension when drawing a pixmap from one X11 screen onto a different X11 screen in the GL 2 engine. For that to work, the pixmap will have to be re-created on the new screen, which is exactly what the default bind method does (via QImage conversion). Task-number: QTBUG-8054 Reviewed-by: Kim
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 fce9fdb..0a89412 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -104,6 +104,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;
};
@@ -2350,7 +2354,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;