summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:45:53 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-02-18 20:50:35 +0100
commit4fe2fbcf827ae6bec976b0b8dcaa5d14bd05dc33 (patch)
treed1ba753b45b09b417a9447ebdfe2fa6fc47dba69 /src/plugins/platforms/eglfs
parentc1da6347e8d3ba73de20ab8fb3e50ec3359b75ac (diff)
parent4889269ff0fb37130b332863e82dd7c19564116c (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/qeglfsintegration.cpp5
-rw-r--r--src/plugins/platforms/eglfs/qeglfswindow.cpp8
2 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfsintegration.cpp b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
index 3d3381323c..88b4692c80 100644
--- a/src/plugins/platforms/eglfs/qeglfsintegration.cpp
+++ b/src/plugins/platforms/eglfs/qeglfsintegration.cpp
@@ -200,11 +200,8 @@ QPlatformWindow *QEglFSIntegration::createPlatformWindow(QWindow *window) const
QPlatformOpenGLContext *QEglFSIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
- // If there is a "root" window into which raster and QOpenGLWidget content is
- // composited, all other contexts must share with its context.
- QOpenGLContext *compositingContext = QOpenGLCompositor::instance()->context();
EGLDisplay dpy = context->screen() ? static_cast<QEglFSScreen *>(context->screen()->handle())->display() : display();
- QPlatformOpenGLContext *share = compositingContext ? compositingContext->handle() : context->shareHandle();
+ QPlatformOpenGLContext *share = context->shareHandle();
QVariant nativeHandle = context->nativeHandle();
QEglFSContext *ctx;
diff --git a/src/plugins/platforms/eglfs/qeglfswindow.cpp b/src/plugins/platforms/eglfs/qeglfswindow.cpp
index c37096160e..2c386e2aea 100644
--- a/src/plugins/platforms/eglfs/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/qeglfswindow.cpp
@@ -142,6 +142,14 @@ void QEglFSWindow::create()
if (Q_UNLIKELY(!context->create()))
qFatal("EGLFS: Failed to create compositing context");
compositor->setTarget(context, window());
+ // If there is a "root" window into which raster and QOpenGLWidget content is
+ // composited, all other contexts must share with its context.
+ if (!qt_gl_global_share_context()) {
+ qt_gl_set_global_share_context(context);
+ // What we set up here is in effect equivalent to the application setting
+ // AA_ShareOpenGLContexts. Set the attribute to be fully consistent.
+ QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts);
+ }
}
}