summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-03-18 15:44:21 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-20 11:50:39 +0100
commit61b2bfac4566061ee425fb5983b2b9504ccc7b80 (patch)
treed30546dbe2b315be101278a0c4622546f18cd7ef /src/core/delegated_frame_node.cpp
parentca417f2aa2a8264f8818bf8dd2df98981b21867b (diff)
Fix the HighDPI rendering of QQuickWebEngineView
Use the ratio given with the compositor frame instead of taking it directly from the QWindow to make sure that we scale according to the rasterizing of the tiles. Set the scale directly on the DelegatedFrameNode by making it a QSGTransformNode to avoid creating an extra QSGNode. Change-Id: I95bd33c7c6d26e0d456d6df188779dc4e82f9d3b Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index d704bf234..2cfcd4afe 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -332,6 +332,13 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
if (!frameData)
return;
+ // DelegatedFrameNode is a transform node only for the purpose of
+ // countering the scale of devicePixel-scaled tiles when rendering them
+ // to the final surface.
+ QMatrix4x4 matrix;
+ matrix.scale(1 / m_data->frameDevicePixelRatio, 1 / m_data->frameDevicePixelRatio);
+ setMatrix(matrix);
+
// Keep the old texture lists around to find the ones we can re-use.
QList<QSharedPointer<RenderPassTexture> > oldRenderPassTextures;
m_renderPassTextures.swap(oldRenderPassTextures);
@@ -368,7 +375,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
rpTexture = QSharedPointer<RenderPassTexture>(new RenderPassTexture(pass->id, sgrc));
}
m_renderPassTextures.append(rpTexture);
- rpTexture->setDevicePixelRatio(m_window->devicePixelRatio());
+ rpTexture->setDevicePixelRatio(m_data->frameDevicePixelRatio);
rpTexture->setRect(toQt(pass->output_rect));
rpTexture->setFormat(pass->has_transparent_background ? GL_RGBA : GL_RGB);
renderPassParent = rpTexture->rootNode();