diff options
Diffstat (limited to 'src/opengl/qopenglcompositorbackingstore.cpp')
-rw-r--r-- | src/opengl/qopenglcompositorbackingstore.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/opengl/qopenglcompositorbackingstore.cpp b/src/opengl/qopenglcompositorbackingstore.cpp index a5cc391e48..931734cf60 100644 --- a/src/opengl/qopenglcompositorbackingstore.cpp +++ b/src/opengl/qopenglcompositorbackingstore.cpp @@ -6,7 +6,7 @@ #include <QtGui/QPainter> #include <qpa/qplatformbackingstore.h> #include <private/qwindow_p.h> -#include <private/qrhi_p.h> +#include <rhi/qrhi.h> #include "qopenglcompositorbackingstore_p.h" #include "qopenglcompositor_p.h" @@ -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<QOpenGLCompositorWindow *>(window->handle()); + if (handle && !handle->backingStore()) + handle->setBackingStore(this); Q_UNUSED(region); Q_UNUSED(offset); @@ -246,6 +249,8 @@ void QOpenGLCompositorBackingStore::resize(const QSize &size, const QRegion &sta QOpenGLCompositor *compositor = QOpenGLCompositor::instance(); QOpenGLContext *dstCtx = compositor->context(); + if (!dstCtx) + return; QWindow *dstWin = compositor->targetWindow(); if (!dstWin) return; |