diff options
author | Axel Spoerl <axel.spoerl@qt.io> | 2023-08-04 07:35:31 +0200 |
---|---|---|
committer | Axel Spoerl <axel.spoerl@qt.io> | 2023-08-04 10:40:05 +0200 |
commit | 86fe84f5f7fd9a55e0f26a9572996caf443ff834 (patch) | |
tree | 3f40f646d034d1e82308daa8321c49b5ea333831 /src/plugins/platforms/eglfs/api/qeglfswindow.cpp | |
parent | 6f6e62650de3d71e27c5bcbc02f10d8b635ffdd8 (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/api/qeglfswindow.cpp')
-rw-r--r-- | src/plugins/platforms/eglfs/api/qeglfswindow.cpp | 6 |
1 files changed, 1 insertions, 5 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; |