Changeset 161087 in webkit


Ignore:
Timestamp:
Dec 26, 2013 7:04:22 AM (10 years ago)
Author:
thiago.lacerda@openbossa.org
Message:

[WK2][CoordinatedGraphics] Removing duplicate scale information from WebVIew.cpp
https://bugs.webkit.org/show_bug.cgi?id=126243

Reviewed by Benjamin Poulain.

The scale factor of the WebView must reflect the same information present in
WebPageProxy.
Previously, in WebView.cpp, there was a m_contentScaleFactor member, which adds
information duplication and needs to be synchronizing with pageScaleFactor in
WebPageProxy. We can avoid this by just making WebView access and set WebPageProxy's
pageScaleFactor directly.

  • UIProcess/CoordinatedGraphics/WebView.cpp:

(WebKit::WebView::WebView):
(WebKit::WebView::setContentScaleFactor):
(WebKit::WebView::transformToScene):
(WebKit::WebView::visibleContentsSize):

  • UIProcess/CoordinatedGraphics/WebView.h:

(WebKit::WebView::contentScaleFactor):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r161077 r161087  
     12013-12-26  Thiago de Barros Lacerda  <thiago.lacerda@openbossa.org>
     2
     3        [WK2][CoordinatedGraphics] Removing duplicate scale information from WebVIew.cpp
     4        https://bugs.webkit.org/show_bug.cgi?id=126243
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        The scale factor of the WebView must reflect the same information present in
     9        WebPageProxy.
     10        Previously, in WebView.cpp, there was a m_contentScaleFactor member, which adds
     11        information duplication and needs to be synchronizing with pageScaleFactor in
     12        WebPageProxy. We can avoid this by just making WebView access and set WebPageProxy's
     13        pageScaleFactor directly.
     14
     15        * UIProcess/CoordinatedGraphics/WebView.cpp:
     16        (WebKit::WebView::WebView):
     17        (WebKit::WebView::setContentScaleFactor):
     18        (WebKit::WebView::transformToScene):
     19        (WebKit::WebView::visibleContentsSize):
     20        * UIProcess/CoordinatedGraphics/WebView.h:
     21        (WebKit::WebView::contentScaleFactor):
     22
    1232013-12-25  Commit Queue  <commit-queue@webkit.org>
    224
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.cpp

    r160833 r161087  
    4949    : m_focused(false)
    5050    , m_visible(false)
    51     , m_contentScaleFactor(1.0)
    5251    , m_opacity(1.0)
    5352{
     
    7877}
    7978
     79void WebView::setContentScaleFactor(float scaleFactor)
     80{
     81    m_page->scalePage(scaleFactor, roundedIntPoint(contentPosition()));
     82    updateViewportSize();
     83}
     84
    8085void WebView::setActive(bool active)
    8186{
     
    239244{
    240245    FloatPoint position = -m_contentPosition;
    241     float effectiveScale = m_contentScaleFactor * m_page->deviceScaleFactor();
     246    float effectiveScale = contentScaleFactor() * m_page->deviceScaleFactor();
    242247    position.scale(effectiveScale, effectiveScale);
    243248
     
    279284{
    280285    FloatSize visibleContentsSize(dipSize());
    281     visibleContentsSize.scale(1 / m_contentScaleFactor);
     286    visibleContentsSize.scale(1 / contentScaleFactor());
    282287
    283288    return visibleContentsSize;
  • trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/WebView.h

    r160392 r161087  
    7171    void setVisible(bool);
    7272
    73     void setContentScaleFactor(float scaleFactor) { m_contentScaleFactor = scaleFactor; }
    74     float contentScaleFactor() const { return m_contentScaleFactor; }
     73    void setContentScaleFactor(float);
     74    float contentScaleFactor() const { return m_page->pageScaleFactor(); }
    7575
    7676    void setContentPosition(const WebCore::FloatPoint& position) { m_contentPosition = position; }
     
    214214    bool m_focused;
    215215    bool m_visible;
    216     float m_contentScaleFactor;
    217216    double m_opacity;
    218217    WebCore::FloatPoint m_contentPosition; // Position in UI units.
Note: See TracChangeset for help on using the changeset viewer.