From 57a61dc907fb132351bbbf2782a73feb0ce93b30 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 6 May 2016 14:59:32 +0200 Subject: 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 --- src/quick/items/qquickitemgrabresult.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/quick/items/qquickitemgrabresult.cpp') 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(); -- cgit v1.2.3