diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-15 17:11:11 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-02-15 17:11:11 (GMT) |
commit | 7455ba4fdc82bc8e7174184090ddfbf03c312446 (patch) | |
tree | 4c30852ee30c8974b2482c5525dc8046a4d0cb52 /src/opengl | |
parent | f95d5bde3ba66dd182802addd15dabbfa85611e1 (diff) | |
parent | 42dda19d82ceea48f19d356cfaf2b26acb763df8 (diff) | |
download | Qt-7455ba4fdc82bc8e7174184090ddfbf03c312446.zip Qt-7455ba4fdc82bc8e7174184090ddfbf03c312446.tar.gz Qt-7455ba4fdc82bc8e7174184090ddfbf03c312446.tar.bz2 |
Merge remote branch 'qt/master' into staging-2-master
Conflicts:
tests/auto/qlineedit/tst_qlineedit.cpp
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/qgl.cpp | 9 | ||||
-rw-r--r-- | src/opengl/qglpixelbuffer_x11.cpp | 6 |
2 files changed, 13 insertions, 2 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; diff --git a/src/opengl/qglpixelbuffer_x11.cpp b/src/opengl/qglpixelbuffer_x11.cpp index 5b34cbb..32a42a2 100644 --- a/src/opengl/qglpixelbuffer_x11.cpp +++ b/src/opengl/qglpixelbuffer_x11.cpp @@ -181,7 +181,11 @@ bool QGLPixelBufferPrivate::init(const QSize &size, const QGLFormat &f, QGLWidge qt_format_to_attrib_list(f, attribs); - GLXFBConfig *configs = glXChooseFBConfig(X11->display, X11->defaultScreen, attribs, &num_configs); + int screen = X11->defaultScreen; + if (shareWidget) + screen = shareWidget->x11Info().screen(); + + GLXFBConfig *configs = glXChooseFBConfig(X11->display, screen, attribs, &num_configs); if (configs && num_configs) { int res; glXGetFBConfigAttrib(X11->display, configs[0], GLX_LEVEL, &res); |