diff options
author | Andras Becsi <andras.becsi@digia.com> | 2013-01-16 08:57:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-01-16 09:24:58 +0100 |
commit | c2c595293e376b2609d8176e86b6f2ad86b45223 (patch) | |
tree | f84a1ce8fe9a0127dd3a63658c2afb02610786ef /Source/WebKit2/WebProcess/WebPage/WebPage.cpp | |
parent | c03f448e170e91ef00dd1846a99e2f094b5919d8 (diff) | |
download | qtwebkit-c2c595293e376b2609d8176e86b6f2ad86b45223.tar.gz |
[Qt][EFL][WK2] Remove redundant device pixel ratio adjustment from PageViewportController
https://bugs.webkit.org/show_bug.cgi?id=106355
Reviewed by Kenneth Rohde Christiansen.
This is a backport of http://trac.webkit.org/changeset/139189.
Since r137597 Qt uses the device pixel ratio of the underlying
platform window as the device pixel ratio in WebCore.
The tiles are rendered with the effective scale (scale adjusted with
the device scale factor) and the projection matrix is also adjusted
with the device pixel ratio when painting.
As a result we can follow the same approach as QtQuick and all the
coordinates in PageViewportController need to be in device independent
pixels (UI pixels) thus we do no longer need to adjust with the device
pixel ratio when calculating the viewport attributes.
This simplifies the logic significantly and increases robustness,
but does not allow to set a custom device pixel ratio different from
the factor of the underlying platform (eg. for testing purposes).
This patch is conceptually a follow-up of r137597 and fixes layout
and canvas size on retina display.
Change-Id: I2485ef0a4aa18726238bacddaa5176cf5869659e
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp')
-rw-r--r-- | Source/WebKit2/WebProcess/WebPage/WebPage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp index 3c256ec84..f8efcbf40 100644 --- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp +++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp @@ -1018,13 +1018,13 @@ void WebPage::sendViewportAttributesChanged() // Recalculate the recommended layout size, when the available size (device pixel) changes. Settings* settings = m_page->settings(); - int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), int(m_viewportSize.width() / m_page->deviceScaleFactor())); + int minimumLayoutFallbackWidth = std::max(settings->layoutFallbackWidth(), m_viewportSize.width()); // If unset we use the viewport dimensions. This fits with the behavior of desktop browsers. int deviceWidth = (settings->deviceWidth() > 0) ? settings->deviceWidth() : m_viewportSize.width(); int deviceHeight = (settings->deviceHeight() > 0) ? settings->deviceHeight() : m_viewportSize.height(); - ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, m_page->deviceScaleFactor(), m_viewportSize); + ViewportAttributes attr = computeViewportAttributes(m_page->viewportArguments(), minimumLayoutFallbackWidth, deviceWidth, deviceHeight, 1, m_viewportSize); attr.initialScale = m_page->viewportArguments().zoom; // Resets auto (-1) if no value was set by user. // This also takes care of the relayout. |