From a3b06ac83de95c2596317c200114d1019e665215 Mon Sep 17 00:00:00 2001 From: Andy Nichols Date: Wed, 12 Jul 2017 14:44:40 +0200 Subject: 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 Reviewed-by: Qt CI Bot --- src/quickwidgets/qquickwidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/quickwidgets/qquickwidget.cpp') 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(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; } -- cgit v1.2.3