summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2017-09-28 14:05:50 +0100
committerDavid Edmundson <davidedmundson@kde.org>2017-10-14 05:53:34 +0000
commit83e9d165761ad68730722aeb0bffb8fabe555d1f (patch)
treec4248256892b56abda25b99a931fc5f22ae099f9
parent6577609b5fb697e0e779f325772087e431877f7c (diff)
Fix QQuickRenderControl software grabs on surface not rendered elsewherev5.10.0-beta2
The softwareRenderer is created in QQuickWindowPrivate::syncSceneGraph If a window is purely offscreen and only read with grabs() this never gets created as we check the software renderer too early. This can be fixed by reordering some code. Change-Id: I882a8c11ab5d285a54b32ab4f53abfbc8c50f449 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/items/qquickrendercontrol.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/items/qquickrendercontrol.cpp b/src/quick/items/qquickrendercontrol.cpp
index 7e995936af..58b76fa862 100644
--- a/src/quick/items/qquickrendercontrol.cpp
+++ b/src/quick/items/qquickrendercontrol.cpp
@@ -393,6 +393,8 @@ QImage QQuickRenderControl::grab()
#endif
} else if (d->window->rendererInterface()->graphicsApi() == QSGRendererInterface::Software) {
QQuickWindowPrivate *cd = QQuickWindowPrivate::get(d->window);
+ cd->polishItems();
+ cd->syncSceneGraph();
QSGSoftwareRenderer *softwareRenderer = static_cast<QSGSoftwareRenderer *>(cd->renderer);
if (softwareRenderer) {
const qreal dpr = d->window->effectiveDevicePixelRatio();
@@ -402,8 +404,6 @@ QImage QQuickRenderControl::grab()
QPaintDevice *prevDev = softwareRenderer->currentPaintDevice();
softwareRenderer->setCurrentPaintDevice(&grabContent);
softwareRenderer->markDirty();
- cd->polishItems();
- cd->syncSceneGraph();
d->rc->endSync();
render();
softwareRenderer->setCurrentPaintDevice(prevDev);