Changeset 176334 in webkit


Ignore:
Timestamp:
Nov 19, 2014, 1:31:11 PM (11 years ago)
Author:
Simon Fraser
Message:

[WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator
https://bugs.webkit.org/show_bug.cgi?id=138876

Reviewed by Beth Dakin.

Fix the position of the tiled scrolling indicator in MiniBrowser by taking top
content offset into account.

On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction
so that we can use it to show the correctly scroll offset in the indicator. This is temporary until
Mac does UI-side scrolling.

  • Shared/mac/RemoteLayerTreeTransaction.h:

(WebKit::RemoteLayerTreeTransaction::scrollPosition):
(WebKit::RemoteLayerTreeTransaction::setScrollPosition):

  • Shared/mac/RemoteLayerTreeTransaction.mm:

(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):

  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:

(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::willCommitLayerTree):

Location:
trunk/Source/WebKit2
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebKit2/ChangeLog

    r176316 r176334  
     12014-11-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        [WK2 UI-side Compositing] Fix the position and scroll indicator of the UI-side tiled scrolling indicator
     4        https://bugs.webkit.org/show_bug.cgi?id=138876
     5
     6        Reviewed by Beth Dakin.
     7       
     8        Fix the position of the tiled scrolling indicator in MiniBrowser by taking top
     9        content offset into account.
     10       
     11        On Mac, pass the current scroll position back to the UI process via the RemoteLayerTreeTransaction
     12        so that we can use it to show the correctly scroll offset in the indicator. This is temporary until
     13        Mac does UI-side scrolling.
     14
     15        * Shared/mac/RemoteLayerTreeTransaction.h:
     16        (WebKit::RemoteLayerTreeTransaction::scrollPosition):
     17        (WebKit::RemoteLayerTreeTransaction::setScrollPosition):
     18        * Shared/mac/RemoteLayerTreeTransaction.mm:
     19        (WebKit::RemoteLayerTreeTransaction::encode):
     20        (WebKit::RemoteLayerTreeTransaction::decode):
     21        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
     22        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
     23        (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
     24        (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
     25        (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
     26        * WebProcess/WebPage/WebPage.cpp:
     27        (WebKit::WebPage::willCommitLayerTree):
     28
    1292014-11-19  Michael Catanzaro  <mcatanzaro@igalia.com>
    230
  • TabularUnified trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h

    r175794 r176334  
    196196    void setPageExtendedBackgroundColor(WebCore::Color color) { m_pageExtendedBackgroundColor = color; }
    197197
     198#if PLATFORM(MAC)
     199    WebCore::IntPoint scrollPosition() const { return m_scrollPosition; }
     200    void setScrollPosition(WebCore::IntPoint p) { m_scrollPosition = p; }
     201#endif
     202
    198203    double pageScaleFactor() const { return m_pageScaleFactor; }
    199204    void setPageScaleFactor(double pageScaleFactor) { m_pageScaleFactor = pageScaleFactor; }
     
    234239
    235240    WebCore::IntSize m_contentsSize;
     241#if PLATFORM(MAC)
     242    WebCore::IntPoint m_scrollPosition;
     243#endif
    236244    WebCore::Color m_pageExtendedBackgroundColor;
    237245    double m_pageScaleFactor;
  • TabularUnified trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm

    r175794 r176334  
    488488
    489489    encoder << m_contentsSize;
     490#if PLATFORM(MAC)
     491    encoder << m_scrollPosition;
     492#endif
    490493    encoder << m_pageExtendedBackgroundColor;
    491494    encoder << m_pageScaleFactor;
     
    549552    if (!decoder.decode(result.m_contentsSize))
    550553        return false;
     554
     555#if PLATFORM(MAC)
     556    if (!decoder.decode(result.m_scrollPosition))
     557        return false;
     558#endif
    551559   
    552560    if (!decoder.decode(result.m_pageExtendedBackgroundColor))
  • TabularUnified trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h

    r174400 r176334  
    7272    float indicatorScale(WebCore::IntSize contentsSize) const;
    7373    virtual void updateDebugIndicator() override;
    74     void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale);
     74    void updateDebugIndicator(WebCore::IntSize contentsSize, bool rootLayerChanged, float scale, const WebCore::IntPoint& scrollPosition);
    7575    void updateDebugIndicatorPosition();
    7676    void initializeDebugIndicator();
  • TabularUnified trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

    r173163 r176334  
    226226        float scale = indicatorScale(layerTreeTransaction.contentsSize());
    227227        bool rootLayerChanged = m_debugIndicatorLayerTreeHost->updateLayerTree(layerTreeTransaction, scale);
    228         updateDebugIndicator(layerTreeTransaction.contentsSize(), rootLayerChanged, scale);
     228        IntPoint scrollPosition;
     229#if PLATFORM(MAC)
     230        scrollPosition = layerTreeTransaction.scrollPosition();
     231#endif
     232        updateDebugIndicator(layerTreeTransaction.contentsSize(), rootLayerChanged, scale, scrollPosition);
    229233        asLayer(m_debugIndicatorLayerTreeHost->rootLayer()).name = @"Indicator host root";
    230234    }
     
    273277    }
    274278   
    275     return FloatPoint(indicatorInset, indicatorInset);
     279    return FloatPoint(indicatorInset, indicatorInset + m_webPageProxy.topContentInset());
    276280}
    277281
     
    304308}
    305309
    306 void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize, bool rootLayerChanged, float scale)
     310void RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator(IntSize contentsSize, bool rootLayerChanged, float scale, const IntPoint& scrollPosition)
    307311{
    308312    // Make sure we're the last sublayer.
     
    334338        [m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), scaledExposedRect.size())];
    335339    } else {
    336         // FIXME: Get the correct scroll position.
     340        [m_exposedRectIndicatorLayer setPosition:scrollPosition];
    337341        [m_exposedRectIndicatorLayer setBounds:FloatRect(FloatPoint(), viewSize)];
    338342    }
  • TabularUnified trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r176297 r176334  
    28762876    layerTransaction.setAllowsUserScaling(allowsUserScaling());
    28772877#endif
     2878#if PLATFORM(MAC)
     2879    layerTransaction.setScrollPosition(corePage()->mainFrame().view()->scrollPosition());
     2880#endif
    28782881}
    28792882
Note: See TracChangeset for help on using the changeset viewer.