Skip to content
Permalink
Browse files
[CoordinatedGraphics][WK2] Correct wrong usage of m_contentPosition v…
…ariable in the WebView.

https://bugs.webkit.org/show_bug.cgi?id=118548

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2013-11-28
Reviewed by Noam Rosenthal.

CoordinatedGraphics uses its own scaling logic - contents scaling - and
WebView of CoordinatedGraphics maintains contents position by scaling
with contents scaling factor.
However transformToScene() and updateViewportSize() of WebView regard
the contents position as a non-scaled value, so it should be fixed.

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::transformToScene):
(WebKit::WebView::updateViewportSize):

Canonical link: https://commits.webkit.org/143115@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@159864 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
eunmi authored and webkit-commit-queue committed Nov 29, 2013
1 parent 5f427d5 commit 2f770d59fc6a6609705535abaaacfe3c6a99d877
Showing with 21 additions and 2 deletions.
  1. +17 −0 Source/WebKit2/ChangeLog
  2. +4 −2 Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp
@@ -1,3 +1,20 @@
2013-11-28 Eunmi Lee <eunmi15.lee@samsung.com>

[CoordinatedGraphics][WK2] Correct wrong usage of m_contentPosition variable in the WebView.
https://bugs.webkit.org/show_bug.cgi?id=118548

Reviewed by Noam Rosenthal.

CoordinatedGraphics uses its own scaling logic - contents scaling - and
WebView of CoordinatedGraphics maintains contents position by scaling
with contents scaling factor.
However transformToScene() and updateViewportSize() of WebView regard
the contents position as a non-scaled value, so it should be fixed.

* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::transformToScene):
(WebKit::WebView::updateViewportSize):

2013-11-28 Ryuan Choi <ryuan.choi@samsung.com>

[EFL] PageViewportController does not need to be unique_ptr instance
@@ -236,7 +236,7 @@ AffineTransform WebView::transformToScene() const
{
FloatPoint position = -m_contentPosition;
float effectiveScale = m_contentScaleFactor * m_page->deviceScaleFactor();
position.scale(effectiveScale, effectiveScale);
position.scale(m_page->deviceScaleFactor(), m_page->deviceScaleFactor());

TransformationMatrix transform = m_userViewportTransform;
transform.translate(position.x(), position.y());
@@ -258,7 +258,9 @@ void WebView::updateViewportSize()
if (CoordinatedDrawingAreaProxy* drawingArea = static_cast<CoordinatedDrawingAreaProxy*>(page()->drawingArea())) {
// Web Process expects sizes in UI units, and not raw device units.
drawingArea->setSize(roundedIntSize(dipSize()), IntSize(), IntSize());
FloatRect visibleContentsRect(contentPosition(), visibleContentsSize());
FloatPoint position = contentPosition();
position.scale(1 / m_contentScaleFactor, 1 / m_contentScaleFactor);
FloatRect visibleContentsRect(position, visibleContentsSize());
visibleContentsRect.intersect(FloatRect(FloatPoint(), contentsSize()));
drawingArea->setVisibleContentsRect(visibleContentsRect, FloatPoint());
}

0 comments on commit 2f770d5

Please sign in to comment.