diff options
author | Laszlo Agocs <[email protected]> | 2014-10-22 10:27:46 +0200 |
---|---|---|
committer | Laszlo Agocs <[email protected]> | 2014-10-22 12:32:47 +0200 |
commit | 9b965f3fa0899e27667aba4c437206fdf7a14969 (patch) | |
tree | 959dc767ff968be55bd35ccd55b3262b22acaafd /src/quick/scenegraph/qsgthreadedrenderloop.cpp | |
parent | d8447fd1b95e6a3f85e7aaed74755e95ecc91dc8 (diff) |
Fix disfunctional QQuickRenderControl with multiple screens
Having a retina and non-retina screen connected resulted in getting
no output from QQuickRenderControl and QQuickWidget on the
non-retina screen.
This is caused by the fact that Quick is blindly calling
QWindow::devicePixelRatio(). This approach is wrong when using
QQuickRenderControl since the QQuickWindow does not have an actual
native window and so devicePixelRatio() merely returns some default value
which will definitely be wrong for one of the screens.
The patch fixes the problem by introducing
QQuickWindow::effectiveDevicePixelRatio(), which, via
QQuickRenderControl::renderWindowFor, supports the redirected case too.
Task-number: QTBUG-42114
Change-Id: I057e01f0a00758dde438fc9b10af3a435b06bb0b
Reviewed-by: Paul Olav Tvete <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 7ac5f0a921..155b52b31a 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -417,7 +417,7 @@ bool QSGRenderThread::event(QEvent *e) QQuickWindowPrivate::get(window)->renderSceneGraph(windowSize); qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- grabbing result"; - *ce->image = qt_gl_read_framebuffer(windowSize * window->devicePixelRatio(), false, false); + *ce->image = qt_gl_read_framebuffer(windowSize * window->effectiveDevicePixelRatio(), false, false); } qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- waking gui to handle result"; waitCondition.wakeOne(); |