summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopenglcompositorbackingstore.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qopenglcompositorbackingstore.cpp')
-rw-r--r--src/opengl/qopenglcompositorbackingstore.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/qopenglcompositorbackingstore.cpp b/src/opengl/qopenglcompositorbackingstore.cpp
index c3b8eb375e..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 &region, 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);
@@ -168,6 +171,7 @@ void QOpenGLCompositorBackingStore::flush(QWindow *window, const QRegion &region
}
QPlatformBackingStore::FlushResult QOpenGLCompositorBackingStore::rhiFlush(QWindow *window,
+ qreal sourceDevicePixelRatio,
const QRegion &region,
const QPoint &offset,
QPlatformTextureList *textures,
@@ -178,6 +182,7 @@ QPlatformBackingStore::FlushResult QOpenGLCompositorBackingStore::rhiFlush(QWind
Q_UNUSED(region);
Q_UNUSED(offset);
Q_UNUSED(translucentBackground);
+ Q_UNUSED(sourceDevicePixelRatio);
m_rhi = rhi();
if (!m_rhi) {
@@ -244,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;