aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitemgrabresult.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-06 14:59:32 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-05-08 20:03:30 +0000
commit57a61dc907fb132351bbbf2782a73feb0ce93b30 (patch)
tree64b3bba9999fe8bd226524d974f20de2ee08d775 /src/quick/items/qquickitemgrabresult.cpp
parent3fe2ecccc96ef1d8243e0683853c5db8c6ed9ee0 (diff)
D3D12: Support QQuickItem::grabToImage
that is, the grabbing of layers. This is where things start getting insane because now the convenient assumptions of updateTexture() for layers only getting called in the sync phase before the rendering of the real frame begins breaks down. With item grabbing the call happens on afterRendering()... the engine will now do a minor hack when doing the readback to make this work. This, together with the previous patches provides us with the following impressive, highly karma-boosting results: tst_scenegraph 24 passed, 0 failed, 11 skipped tst_qquickwindow 52 passed, 0 failed, 6 skipped tst_qquickitem 61 passed, 0 failed, 0 skipped tst_qquickitem2 84 passed, 0 failed, 6 skipped Change-Id: I8f160e6848215a3b3304f2e00516eea0d96eb4a0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/items/qquickitemgrabresult.cpp')
-rw-r--r--src/quick/items/qquickitemgrabresult.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/quick/items/qquickitemgrabresult.cpp b/src/quick/items/qquickitemgrabresult.cpp
index 3ff61be241..f69b5b3f4b 100644
--- a/src/quick/items/qquickitemgrabresult.cpp
+++ b/src/quick/items/qquickitemgrabresult.cpp
@@ -240,8 +240,7 @@ void QQuickItemGrabResult::render()
return;
d->texture->setRect(QRectF(0, d->itemSize.height(), d->itemSize.width(), -d->itemSize.height()));
- QSGContext *sg = QSGDefaultRenderContext::from(QOpenGLContext::currentContext())->sceneGraphContext();
- const QSize minSize = sg->minimumFBOSize();
+ const QSize minSize = QQuickWindowPrivate::get(d->window.data())->context->sceneGraphContext()->minimumFBOSize();
d->texture->setSize(QSize(qMax(minSize.width(), d->textureSize.width()),
qMax(minSize.height(), d->textureSize.height())));
d->texture->scheduleUpdate();