aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgrhisupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r--src/quick/scenegraph/qsgrhisupport.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp
index 57cd51f171..25b7b620e0 100644
--- a/src/quick/scenegraph/qsgrhisupport.cpp
+++ b/src/quick/scenegraph/qsgrhisupport.cpp
@@ -1334,7 +1334,11 @@ QImage QSGRhiSupport::grabOffscreen(QQuickWindow *window)
// There was no rendercontrol which means a custom render target
// should not be set either. Set our own, temporarily.
- window->setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(rt.data()));
+ auto renderTarget = QQuickRenderTarget::fromRhiRenderTarget(rt.data());
+ // Pass on the scale factor. No need to use effectiveDevicePixelRatio(),
+ // because there is no rendercontrol anyway.
+ renderTarget.setDevicePixelRatio(window->devicePixelRatio());
+ window->setRenderTarget(renderTarget);
QRhiCommandBuffer *cb = nullptr;
if (rhi->beginOffscreenFrame(&cb) != QRhi::FrameOpSuccess) {