diff options
author | Arvid Nilsson <anilsson@blackberry.com> | 2014-04-09 14:35:10 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-09 23:08:28 +0200 |
commit | b6bf63c3fa9d959a5ab3e3c04ef848687f15a718 (patch) | |
tree | 2fba3f58eabe16904e10cf194bb8f356a5a23231 | |
parent | 7c1b3d6e2a7c4b7bfa548133069275a4852b0d08 (diff) |
Fix broken experimental.viewport.devicePixelRatio
The experimental.viewport.devicePixelRatio should be applied in
addition to any native devicePixelRatio inherent in the window system
or GUI framework.
This patch updates RenderWidgetHostViewQt::OnSwapCompositorFrame to
match the implementation of RenderWidgetHostViewQt::GetScreenInfo and
take the dpiScale (experimental.viewport.devicePixelRatio) into
account.
Change-Id: Ieadd9fbc73d937d5b5a318091c1157b281bd23c9
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 7d470e5cf..8e50ea2e5 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -596,6 +596,12 @@ void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32 output_surface_id, sco Q_ASSERT(!m_frameNodeData->frameData || m_frameNodeData->frameData->resource_list.empty()); m_frameNodeData->frameData = frame->delegated_frame_data.Pass(); m_frameNodeData->frameDevicePixelRatio = frame->metadata.device_scale_factor; + + // Support experimental.viewport.devicePixelRatio, see GetScreenInfo implementation below. + float dpiScale = this->dpiScale(); + if (dpiScale != 0 && dpiScale != 1) + m_frameNodeData->frameDevicePixelRatio /= dpiScale; + m_delegate->update(); } @@ -605,6 +611,8 @@ void RenderWidgetHostViewQt::GetScreenInfo(blink::WebScreenInfo* results) if (!window) return; GetScreenInfoFromNativeWindow(window, results); + + // Support experimental.viewport.devicePixelRatio results->deviceScaleFactor *= dpiScale(); } |