diff --git a/src/opengl/qopenglcompositor_p.h b/src/opengl/qopenglcompositor_p.h index abe8d4959e..66dd77c1c2 100644 --- a/src/opengl/qopenglcompositor_p.h +++ b/src/opengl/qopenglcompositor_p.h @@ -29,6 +29,7 @@ class QOpenGLFramebufferObject; class QWindow; class QPlatformTextureList; +class QOpenGLCompositorBackingStore; class QOpenGLCompositorWindow { public: @@ -37,6 +38,8 @@ public: virtual const QPlatformTextureList *textures() const = 0; virtual void beginCompositing() { } virtual void endCompositing() { } + virtual void setBackingStore(QOpenGLCompositorBackingStore *backingStore) = 0; + virtual QOpenGLCompositorBackingStore *backingStore() const = 0; }; class Q_OPENGL_EXPORT QOpenGLCompositor : public QObject diff --git a/src/opengl/qopenglcompositorbackingstore.cpp b/src/opengl/qopenglcompositorbackingstore.cpp index 8bc1ec75ff..8efccce579 100644 --- a/src/opengl/qopenglcompositorbackingstore.cpp +++ b/src/opengl/qopenglcompositorbackingstore.cpp @@ -137,6 +137,9 @@ void QOpenGLCompositorBackingStore::updateTexture() void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion ®ion, const QPoint &offset) { // Called for ordinary raster windows. + auto *handle = dynamic_cast(window->handle()); + if (handle && !handle->backingStore()) + handle->setBackingStore(this); Q_UNUSED(region); Q_UNUSED(offset); diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h index d111042040..e51cd69f3d 100644 --- a/src/plugins/platforms/eglfs/api/qeglfswindow_p.h +++ b/src/plugins/platforms/eglfs/api/qeglfswindow_p.h @@ -70,8 +70,8 @@ public: bool isRaster() const; #ifndef QT_NO_OPENGL - QOpenGLCompositorBackingStore *backingStore() { return m_backingStore; } - void setBackingStore(QOpenGLCompositorBackingStore *backingStore); + QOpenGLCompositorBackingStore *backingStore() const override { return m_backingStore; } + void setBackingStore(QOpenGLCompositorBackingStore *backingStore) override; QWindow *sourceWindow() const override; const QPlatformTextureList *textures() const override; void endCompositing() override;