summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_x11gl_egl.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-21 14:32:54 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-21 14:32:54 (GMT)
commit0ed389f6d1bedb4caffde70f22efae91d70c4a90 (patch)
treee88b8ee3f9f07917b284af117b7a415a81da6040 /src/opengl/qpixmapdata_x11gl_egl.cpp
parentc74dac2a0ef5d1b428c4da4e48fab05f9886233a (diff)
parentad0c6b17cde4a3ce0041d1a54b96ccb5a6792520 (diff)
downloadQt-0ed389f6d1bedb4caffde70f22efae91d70c4a90.zip
Qt-0ed389f6d1bedb4caffde70f22efae91d70c4a90.tar.gz
Qt-0ed389f6d1bedb4caffde70f22efae91d70c4a90.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (22 commits) Fixes wrong QGraphicsView's viewport cursor reset. Optimize ~QObject Document that QFileSystemWatcher needs to be destroyed before ~QCoreApp Build fix for mingw Fixes keyboard shortcuts for QGraphicsTextItem. Optimize QMetaObject::activate Benchmark emission of signal connected to nothing Micro optimisations in QMutexLocker Fixed assert failure when trying to load invalid SVG file. Added QIcon::name() QDialog: user-moved dialog would not show on the same place after hide Fixed image drawing inconsistencies when drawing 1x1 images/subrects. Fixed pixel-bleeding when stretching subrected pixmaps. Fixed a crash when declaring an animation with Q_GLOBAL_STATIC Add a test to QListView to check initialisation of style option index, similar to QTreeView test. Odf export: Remove double namespace in tab-stops and fix table padding Mac: Fix off-by-one in vertical position for elided and non-elided text QX11GL: Fix bug with pixmaps drawn on multiple top-levels Use QGLContextPrivate to track attribarray enabled state. Don't crash when calling drawPixmapFragements with a null pixmap ...
Diffstat (limited to 'src/opengl/qpixmapdata_x11gl_egl.cpp')
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index 3ab385a..4d726b6 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -66,7 +66,8 @@ QT_BEGIN_NAMESPACE
// different contexts:
Q_GLOBAL_STATIC(QEglContext, qt_x11gl_rgbContext);
-Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext)
+Q_GLOBAL_STATIC(QEglContext, qt_x11gl_argbContext);
+Q_GLOBAL_STATIC_WITH_ARGS(QGLContext, qt_x11gl_fake_shared_context, (QX11GLPixmapData::glFormat()));
QEglContext* QX11GLPixmapData::rgbContext = 0;
QEglContext* QX11GLPixmapData::argbContext = 0;
@@ -112,7 +113,13 @@ bool QX11GLPixmapData::hasX11GLPixmaps()
if (!argbContext) {
argbContext = qt_x11gl_argbContext();
argbContext->setConfig(argbConfig);
- argbContext->createContext();
+ bool success = argbContext->createContext(rgbContext);
+ if (!success) {
+ qWarning("QX11GLPixmapData - RGB & ARGB contexts aren't shared");
+ success = argbContext->createContext();
+ if (!success)
+ argbContext = rgbContext; // Might work, worth a shot at least.
+ }
}
if (!argbContext->isValid())
@@ -258,6 +265,14 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const
ctx = new QGLContext(glFormat());
Q_ASSERT(ctx->d_func()->eglContext == 0);
ctx->d_func()->eglContext = hasAlphaChannel() ? argbContext : rgbContext;
+
+ // While we use a seperate QGLContext for each pixmap, the underlying QEglContext is
+ // the same. So we must use a "fake" QGLContext and fool the texture cache into thinking
+ // each pixmap's QGLContext is sharing with this central one. The only place this is
+ // going to fail is where we the underlying EGL RGB and ARGB contexts aren't sharing.
+ ctx->d_func()->sharing = true;
+ QGLContextGroup::addShare(ctx, qt_x11gl_fake_shared_context());
+
// Update the glFormat for the QGLContext:
qt_glformat_from_eglconfig(ctx->d_func()->glFormat, ctx->d_func()->eglContext->config());
}