diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 517dd1ea42..b6e96a457e 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -32,7 +32,6 @@ class QScreen; class QWindow; class QIcon; class QRegion; -class QPlatformBackingStore; class Q_GUI_EXPORT QPlatformWindow : public QPlatformSurface { @@ -118,8 +117,6 @@ public: virtual void requestUpdate(); bool hasPendingUpdateRequest() const; virtual void deliverUpdateRequest(); -#define QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE // remove when all modules have migrated - virtual void setBackingStore(QPlatformBackingStore *) {} // Window property accessors. Platform plugins should use these // instead of accessing QWindow directly. diff --git a/src/platformsupport/fbconvenience/qfbscreen.cpp b/src/platformsupport/fbconvenience/qfbscreen.cpp index a5d87fec04..e804488005 100644 --- a/src/platformsupport/fbconvenience/qfbscreen.cpp +++ b/src/platformsupport/fbconvenience/qfbscreen.cpp @@ -47,7 +47,6 @@ bool QFbScreen::event(QEvent *event) void QFbScreen::addWindow(QFbWindow *window) { - Q_ASSERT(window->backingStore()); mWindowStack.prepend(window); if (!mPendingBackingStores.isEmpty()) { //check if we have a backing store for this window diff --git a/src/platformsupport/fbconvenience/qfbwindow.cpp b/src/platformsupport/fbconvenience/qfbwindow.cpp index 8df50a14da..54716cc497 100644 --- a/src/platformsupport/fbconvenience/qfbwindow.cpp +++ b/src/platformsupport/fbconvenience/qfbwindow.cpp @@ -3,11 +3,9 @@ #include "qfbwindow_p.h" #include "qfbscreen_p.h" -#include "qfbbackingstore_p.h" #include #include -#include QT_BEGIN_NAMESPACE @@ -113,11 +111,5 @@ void QFbWindow::repaint(const QRegion ®ion) for (auto rect : region) platformScreen()->setDirty(rect.translated(topLeft)); } -void QFbWindow::setBackingStore(QPlatformBackingStore *store) -{ - Q_ASSERT(store); - Q_ASSERT_X(dynamic_cast(store), __FUNCTION__, - "Argument is not a QFbBackingStore."); - mBackingStore = static_cast(store); -} + QT_END_NAMESPACE diff --git a/src/platformsupport/fbconvenience/qfbwindow_p.h b/src/platformsupport/fbconvenience/qfbwindow_p.h index 8848e9dcf8..8367a10bce 100644 --- a/src/platformsupport/fbconvenience/qfbwindow_p.h +++ b/src/platformsupport/fbconvenience/qfbwindow_p.h @@ -41,7 +41,7 @@ public: WId winId() const override { return mWindowId; } - void setBackingStore(QPlatformBackingStore *store) override; + void setBackingStore(QFbBackingStore *store) { mBackingStore = store; } QFbBackingStore *backingStore() const { return mBackingStore; } QFbScreen *platformScreen() const; diff --git a/src/plugins/platforms/android/qandroidplatformbackingstore.cpp b/src/plugins/platforms/android/qandroidplatformbackingstore.cpp index 33c422bb1e..09cc9ce8c6 100644 --- a/src/plugins/platforms/android/qandroidplatformbackingstore.cpp +++ b/src/plugins/platforms/android/qandroidplatformbackingstore.cpp @@ -25,10 +25,11 @@ void QAndroidPlatformBackingStore::flush(QWindow *window, const QRegion ®ion, { Q_UNUSED(offset); - if (!m_backingStoreSet) + auto *platformWindow = static_cast(window->handle()); + if (!platformWindow->backingStore()) setBackingStore(window); - (static_cast(window->handle()))->repaint(region); + platformWindow->repaint(region); } void QAndroidPlatformBackingStore::resize(const QSize &size, const QRegion &staticContents) @@ -42,7 +43,6 @@ void QAndroidPlatformBackingStore::resize(const QSize &size, const QRegion &stat void QAndroidPlatformBackingStore::setBackingStore(QWindow *window) { (static_cast(window->handle()))->setBackingStore(this); - m_backingStoreSet = true; } QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformbackingstore.h b/src/plugins/platforms/android/qandroidplatformbackingstore.h index 810305ac45..b64a9f27bb 100644 --- a/src/plugins/platforms/android/qandroidplatformbackingstore.h +++ b/src/plugins/platforms/android/qandroidplatformbackingstore.h @@ -21,7 +21,6 @@ public: void setBackingStore(QWindow *window); protected: QImage m_image; - bool m_backingStoreSet = false; }; QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformscreen.cpp b/src/plugins/platforms/android/qandroidplatformscreen.cpp index 2f33816824..54c7a34efe 100644 --- a/src/plugins/platforms/android/qandroidplatformscreen.cpp +++ b/src/plugins/platforms/android/qandroidplatformscreen.cpp @@ -43,7 +43,7 @@ public: } private: - QElapsedTimer m_timer; + QTime m_timer; QString m_msg; }; diff --git a/src/plugins/platforms/android/qandroidplatformwindow.cpp b/src/plugins/platforms/android/qandroidplatformwindow.cpp index 1bc4a04b98..b1eba17d04 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.cpp +++ b/src/plugins/platforms/android/qandroidplatformwindow.cpp @@ -5,9 +5,9 @@ #include "qandroidplatformwindow.h" #include "qandroidplatformopenglcontext.h" #include "qandroidplatformscreen.h" -#include "qandroidplatformbackingstore.h" + #include "androidjnimain.h" -#include "qpa/qplatformbackingstore.h" + #include #include #include @@ -169,12 +169,4 @@ void QAndroidPlatformWindow::applicationStateChanged(Qt::ApplicationState) QWindowSystemInterface::flushWindowSystemEvents(); } -void QAndroidPlatformWindow::setBackingStore(QPlatformBackingStore *store) -{ - Q_ASSERT(store); - Q_ASSERT_X(dynamic_cast(store), __FUNCTION__, - "Argument is not a QAndroidPlatformBackingStore."); - m_backingStore = static_cast(store); -} - QT_END_NAMESPACE diff --git a/src/plugins/platforms/android/qandroidplatformwindow.h b/src/plugins/platforms/android/qandroidplatformwindow.h index ee2771ee11..6fccc2e7fe 100644 --- a/src/plugins/platforms/android/qandroidplatformwindow.h +++ b/src/plugins/platforms/android/qandroidplatformwindow.h @@ -50,7 +50,7 @@ public: virtual void applicationStateChanged(Qt::ApplicationState); - void setBackingStore(QPlatformBackingStore *store) override; + void setBackingStore(QAndroidPlatformBackingStore *store) { m_backingStore = store; } QAndroidPlatformBackingStore *backingStore() const { return m_backingStore; } virtual void repaint(const QRegion &) { } 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(store), __FUNCTION__, - "Argument is not a QOpenGLCompositorBackingStore."); - auto *backingStore = static_cast(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; diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 7a5cc19d13..21800e3b0b 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -236,14 +236,6 @@ QWasmScreen *QWasmWindow::platformScreen() const return static_cast(window()->screen()->handle()); } -void QWasmWindow::setBackingStore(QPlatformBackingStore *store) -{ - Q_ASSERT(store); - Q_ASSERT_X(dynamic_cast(store), __FUNCTION__, - "Argument is not a QWasmBackingStore."); - m_backingStore = static_cast(store); -} - void QWasmWindow::paint() { if (!m_backingStore || !isVisible() || m_context2d.isUndefined()) diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h index 40f7a4df12..3e7f215b6f 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.h +++ b/src/plugins/platforms/wasm/qwasmwindow.h @@ -89,7 +89,7 @@ public: void setParent(const QPlatformWindow *window) final; QWasmScreen *platformScreen() const; - void setBackingStore(QPlatformBackingStore *store) override; + void setBackingStore(QWasmBackingStore *store) { m_backingStore = store; } QWasmBackingStore *backingStore() const { return m_backingStore; } QWindow *window() const { return m_window; } diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 64e55bd34b..b8ae2875a8 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1332,11 +1332,6 @@ void QWidgetPrivate::create() QBackingStore *store = q->backingStore(); usesRhiFlush = false; - // Re-use backing store, in case a new platform window was created and doesn't know about it. - // (e.g. QAndroidPlatformWindow) - if (store && q->windowHandle()) - q->windowHandle()->handle()->setBackingStore(store->handle()); - if (!store) { if (q->windowType() != Qt::Desktop) { if (q->isWindow()) {