aboutsummaryrefslogtreecommitdiffstats
path: root/src/quickwidgets/qquickwidget.cpp
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@qt.io>2017-07-12 14:44:40 +0200
committerAndy Nichols <andy.nichols@qt.io>2017-10-17 11:32:04 +0000
commita3b06ac83de95c2596317c200114d1019e665215 (patch)
tree48c304896509efe207d34401a2d8ae6899c192a0 /src/quickwidgets/qquickwidget.cpp
parent341a04377bcb0fb1fd7c2c52bd4a8b7cfd35b44c (diff)
Software Adaptation: Fix QQuickWidget when moving between screens
When changing between screens, the QImage representing the contents of the scene will be changed, but the software adaptation was only updating the contents of the image that had change since the last frame, leading to uninitialized image data being shown. Now QQuickWidget will force a full repaint on the new image. Task-number: QTBUG-61798 Change-Id: Iab200faee8cf6457f2eab6d33dddbe7781c9fcf1 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/quickwidgets/qquickwidget.cpp')
-rw-r--r--src/quickwidgets/qquickwidget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 5aff0ee393..4c4f5fa9f3 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -201,6 +201,7 @@ QQuickWidgetPrivate::QQuickWidgetPrivate()
, fakeHidden(false)
, requestedSamples(0)
, useSoftwareRenderer(false)
+ , forceFullUpdate(false)
{
}
@@ -306,6 +307,10 @@ void QQuickWidgetPrivate::render(bool needsSync)
auto softwareRenderer = static_cast<QSGSoftwareRenderer*>(cd->renderer);
if (softwareRenderer && !softwareImage.isNull()) {
softwareRenderer->setCurrentPaintDevice(&softwareImage);
+ if (forceFullUpdate) {
+ softwareRenderer->markDirty();
+ forceFullUpdate = false;
+ }
renderControl->render();
updateRegion += softwareRenderer->flushRegion();
@@ -916,6 +921,7 @@ void QQuickWidget::createFramebufferObject()
const QSize imageSize = size() * devicePixelRatioF();
d->softwareImage = QImage(imageSize, QImage::Format_ARGB32_Premultiplied);
d->softwareImage.setDevicePixelRatio(devicePixelRatioF());
+ d->forceFullUpdate = true;
return;
}