summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorAxel Spoerl <axel.spoerl@qt.io>2023-08-04 07:35:31 +0200
committerAxel Spoerl <axel.spoerl@qt.io>2023-08-04 10:40:05 +0200
commit86fe84f5f7fd9a55e0f26a9572996caf443ff834 (patch)
tree3f40f646d034d1e82308daa8321c49b5ea333831 /src/plugins/platforms/eglfs
parent6f6e62650de3d71e27c5bcbc02f10d8b635ffdd8 (diff)
Fix link to platform window in QAndroidPlatformBackingStore::flush()
The Android QPA implementation requires a 1:1 link between a platform window and a platform backing store, to correctly flush a backing store to the screen. QAndroidPlatformBackingStore has a bool member m_backingStoreSet, to remember if this link exists. It defaults to false and is set to true, when setBackingStore() is called in the constructor. It falsely remains true, when a platform window is deleted, e.g. because a QWindow has been hidden. When the QWindow is shown again, a new Android platform window is created. With m_backingStoreSet still being true, this new platform window will never be associated with a backing store. As a consequence, it will never be displayed on the screen. The 1:1 relationship of an Android platform window and an Android backing store is neither ideal, nor in line with other QPA layers (e.g. XCB). Changing the Android QPA implementation is complex and a short term fix is necessary. This patch removes the member m_backingStoreSet. Instead of it, QAndroidPlatformBackingStore::flush() directly checks, if the platform window corresponding to the QWindow argument is associated to a backing store. If that is not the case, setBackingStore() is called. QTBUG-97482 has been fixed with another approach, which this patch reverts. The following commits are effectively reverted by this patch: 9a39ad8dfb4e6d1a179bd0fa38026886f8f7cb8e f91588923b1e7b68f1bd79b38af44d024df85996 a4ca9e80658bca7dad1529f03c1b59173a6ecf62 dbb072eb2838a04e89e34dad686394a496d5de87 959a8b3967ac3b6315f5b458628ec5661dfc367e Fixes: QTBUG-97482 Pick-to: 6.6 6.5 6.2 Change-Id: Ic4344f8df2e954c057dd2705340f11dfd2d4c6fe Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp6
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow_p.h2
2 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 6210ef16a8..1a31f97d7b 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -108,12 +108,8 @@ void QEglFSWindow::create()
#endif
}
-void QEglFSWindow::setBackingStore(QPlatformBackingStore *store)
+void QEglFSWindow::setBackingStore(QOpenGLCompositorBackingStore *backingStore)
{
- Q_ASSERT(store);
- Q_ASSERT_X(dynamic_cast<QOpenGLCompositorBackingStore *>(store), __FUNCTION__,
- "Argument is not a QOpenGLCompositorBackingStore.");
- auto *backingStore = static_cast<QOpenGLCompositorBackingStore *>(store);
#ifndef QT_NO_OPENGL
if (!m_rasterCompositingContext) {
m_rasterCompositingContext = new QOpenGLContext;
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
index d8e0a4a735..d111042040 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h
@@ -71,7 +71,7 @@ public:
#ifndef QT_NO_OPENGL
QOpenGLCompositorBackingStore *backingStore() { return m_backingStore; }
- void setBackingStore(QPlatformBackingStore *backingStore) override;
+ void setBackingStore(QOpenGLCompositorBackingStore *backingStore);
QWindow *sourceWindow() const override;
const QPlatformTextureList *textures() const override;
void endCompositing() override;