summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-01 01:00:53 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-01 01:00:54 +0100
commit7aa204d5b30d3d55ac838b4df601feaa368412b8 (patch)
treeecc155d46985f1143845d3bd13074914149f22f3 /src/plugins/platforms/eglfs
parentc47ec42f02196f387c28ab1a5ac70a23ec642a63 (diff)
parent55b464196297afc11cb9836f61f737e6fdaf04dc (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfsscreen.cpp3
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp27
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow_p.h1
3 files changed, 18 insertions, 13 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
index 285dbd93d3..11b68c0589 100644
--- a/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfsscreen.cpp
@@ -62,9 +62,6 @@ QEglFSScreen::QEglFSScreen(EGLDisplay dpy)
QEglFSScreen::~QEglFSScreen()
{
delete m_cursor;
-#ifndef QT_NO_OPENGL
- QOpenGLCompositor::destroy();
-#endif
}
QRect QEglFSScreen::geometry() const
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 29cfd4ea79..98e9ee4728 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -62,6 +62,7 @@ QEglFSWindow::QEglFSWindow(QWindow *w)
: QPlatformWindow(w),
#ifndef QT_NO_OPENGL
m_backingStore(0),
+ m_rasterCompositingContext(0),
#endif
m_raster(false),
m_winId(0),
@@ -144,18 +145,18 @@ void QEglFSWindow::create()
#ifndef QT_NO_OPENGL
if (isRaster()) {
- QOpenGLContext *context = new QOpenGLContext(QGuiApplication::instance());
- context->setShareContext(qt_gl_global_share_context());
- context->setFormat(m_format);
- context->setScreen(window()->screen());
- if (Q_UNLIKELY(!context->create()))
+ m_rasterCompositingContext = new QOpenGLContext;
+ m_rasterCompositingContext->setShareContext(qt_gl_global_share_context());
+ m_rasterCompositingContext->setFormat(m_format);
+ m_rasterCompositingContext->setScreen(window()->screen());
+ if (Q_UNLIKELY(!m_rasterCompositingContext->create()))
qFatal("EGLFS: Failed to create compositing context");
- compositor->setTarget(context, window(), screen->rawGeometry());
+ compositor->setTarget(m_rasterCompositingContext, window(), screen->rawGeometry());
compositor->setRotation(qEnvironmentVariableIntValue("QT_QPA_EGLFS_ROTATION"));
// 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);
+ qt_gl_set_global_share_context(m_rasterCompositingContext);
// 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);
@@ -166,6 +167,10 @@ void QEglFSWindow::create()
void QEglFSWindow::destroy()
{
+#ifndef QT_NO_OPENGL
+ QOpenGLCompositor::instance()->removeWindow(this);
+#endif
+
QEglFSScreen *screen = this->screen();
if (m_flags.testFlag(HasNativeWindow)) {
#ifndef QT_NO_OPENGL
@@ -177,12 +182,14 @@ void QEglFSWindow::destroy()
screen->setPrimarySurface(EGL_NO_SURFACE);
invalidateSurface();
- }
- m_flags = 0;
#ifndef QT_NO_OPENGL
- QOpenGLCompositor::instance()->removeWindow(this);
+ QOpenGLCompositor::destroy();
+ delete m_rasterCompositingContext;
#endif
+ }
+
+ m_flags = 0;
}
void QEglFSWindow::invalidateSurface()
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
index c61f04f569..b0091e2a62 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
@@ -116,6 +116,7 @@ public:
protected:
#ifndef QT_NO_OPENGL
QOpenGLCompositorBackingStore *m_backingStore;
+ QOpenGLContext *m_rasterCompositingContext;
#endif
bool m_raster;
WId m_winId;