Changeset 165235 in webkit


Ignore:
Timestamp:
Mar 6, 2014 6:01:39 PM (10 years ago)
Author:
Simon Fraser
Message:

Send the fixed position rect to the WebProcess along with the other rects
https://bugs.webkit.org/show_bug.cgi?id=129856

Reviewed by Benjamin Poulain.

Remove the functions that pass the custom fixed position rect through
the DrawingArea, and replace them by adding this rect to the
VisibleContentRectUpdateInfo, along with the "is stable" flag. We
then set the custom fixed position rect in the web process for
stable updates.

  • Shared/VisibleContentRectUpdateInfo.cpp:

(WebKit::VisibleContentRectUpdateInfo::encode):
(WebKit::VisibleContentRectUpdateInfo::decode):

  • Shared/VisibleContentRectUpdateInfo.h:

(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect):
(WebKit::VisibleContentRectUpdateInfo::inStableState):
(WebKit::operator==):

  • UIProcess/DrawingAreaProxy.cpp:
  • UIProcess/ios/WKContentView.mm:

(-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):

  • WebProcess/WebPage/DrawingArea.h:
  • WebProcess/WebPage/DrawingArea.messages.in:
  • WebProcess/WebPage/ios/WebPageIOS.mm:

(WebKit::WebPage::updateVisibleContentRects):

  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
  • WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
Location:
trunk/Source/WebKit2
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r165234 r165235  
     12014-03-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Send the fixed position rect to the WebProcess along with the other rects
     4        https://bugs.webkit.org/show_bug.cgi?id=129856
     5
     6        Reviewed by Benjamin Poulain.
     7       
     8        Remove the functions that pass the custom fixed position rect through
     9        the DrawingArea, and replace them by adding this rect to the
     10        VisibleContentRectUpdateInfo, along with the "is stable" flag. We
     11        then set the custom fixed position rect in the web process for
     12        stable updates.
     13
     14        * Shared/VisibleContentRectUpdateInfo.cpp:
     15        (WebKit::VisibleContentRectUpdateInfo::encode):
     16        (WebKit::VisibleContentRectUpdateInfo::decode):
     17        * Shared/VisibleContentRectUpdateInfo.h:
     18        (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
     19        (WebKit::VisibleContentRectUpdateInfo::customFixedPositionRect):
     20        (WebKit::VisibleContentRectUpdateInfo::inStableState):
     21        (WebKit::operator==):
     22        * UIProcess/DrawingAreaProxy.cpp:
     23        * UIProcess/ios/WKContentView.mm:
     24        (-[WKContentView didUpdateVisibleRect:unobscuredRect:scale:inStableState:]):
     25        * WebProcess/WebPage/DrawingArea.h:
     26        * WebProcess/WebPage/DrawingArea.messages.in:
     27        * WebProcess/WebPage/ios/WebPageIOS.mm:
     28        (WebKit::WebPage::updateVisibleContentRects):
     29        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
     30        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
     31        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
     32
    1332014-03-06  Simon Fraser  <simon.fraser@apple.com>
    234
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.cpp

    r164702 r165235  
    3535    encoder << m_exposedRect;
    3636    encoder << m_unobscuredRect;
     37    encoder << m_customFixedPositionRect;
    3738    encoder << m_scale;
     39    encoder << m_inStableState;
    3840}
    3941
     
    4446    if (!decoder.decode(result.m_unobscuredRect))
    4547        return false;
     48    if (!decoder.decode(result.m_customFixedPositionRect))
     49        return false;
    4650    if (!decoder.decode(result.m_scale))
     51        return false;
     52    if (!decoder.decode(result.m_inStableState))
    4753        return false;
    4854    return true;
  • trunk/Source/WebKit2/Shared/VisibleContentRectUpdateInfo.h

    r164702 r165235  
    4343    }
    4444
    45     VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, double scale)
     45    VisibleContentRectUpdateInfo(const WebCore::FloatRect& exposedRect, const WebCore::FloatRect& unobscuredRect, const WebCore::FloatRect& customFixedPositionRect, double scale, bool inStableState)
    4646        : m_exposedRect(exposedRect)
    4747        , m_unobscuredRect(unobscuredRect)
     48        , m_customFixedPositionRect(customFixedPositionRect)
    4849        , m_scale(scale)
     50        , m_inStableState(inStableState)
    4951    {
    5052    }
     
    5254    const WebCore::FloatRect& exposedRect() const { return m_exposedRect; }
    5355    const WebCore::FloatRect& unobscuredRect() const { return m_unobscuredRect; }
     56    const WebCore::FloatRect& customFixedPositionRect() const { return m_customFixedPositionRect; }
    5457    double scale() const { return m_scale; }
     58    bool inStableState() const { return m_inStableState; }
    5559
    5660    void encode(IPC::ArgumentEncoder&) const;
     
    6064    WebCore::FloatRect m_exposedRect;
    6165    WebCore::FloatRect m_unobscuredRect;
     66    WebCore::FloatRect m_customFixedPositionRect;
    6267    double m_scale;
     68    bool m_inStableState;
    6369};
    6470
    6571inline bool operator==(const VisibleContentRectUpdateInfo& a, const VisibleContentRectUpdateInfo& b)
    6672{
    67     return a.scale() == b.scale() && a.exposedRect() == b.exposedRect() && a.unobscuredRect() == b.unobscuredRect();
     73    return a.scale() == b.scale()
     74        && a.exposedRect() == b.exposedRect()
     75        && a.unobscuredRect() == b.unobscuredRect()
     76        && a.customFixedPositionRect() == b.customFixedPositionRect()
     77        && a.inStableState() == b.inStableState();
    6878}
    6979
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.cpp

    r164710 r165235  
    8888#endif // PLATFORM(MAC)
    8989
    90 #if PLATFORM(COCOA)
    91 void DrawingAreaProxy::setCustomFixedPositionRect(const FloatRect& fixedPositionRect)
    92 {
    93     if (!m_webPageProxy->isValid())
    94         return;
    95 
    96     m_webPageProxy->process().send(Messages::DrawingArea::SetCustomFixedPositionRect(fixedPositionRect), m_webPageProxy->pageID());
    97 }
    98 #endif
    99 
    10090} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r165230 r165235  
    172172        scale = _page->displayedContentScale();
    173173    }
    174    
    175     _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, scale));
     174
     175    FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale];
     176    _page->updateVisibleContentRects(VisibleContentRectUpdateInfo(visibleRect, unobscuredRect, fixedPosRect, scale, isStableState));
    176177
    177178    RemoteScrollingCoordinatorProxy* scrollingCoordinator = _page->scrollingCoordinatorProxy();
    178179    scrollingCoordinator->scrollPositionChangedViaDelegatedScrolling(scrollingCoordinator->rootScrollingNodeID(), unobscuredRect.origin);
    179180
    180     if (auto drawingArea = _page->drawingArea()) {
    181         if (isStableState) {
    182             FloatRect fixedPosRect = [self fixedPositionRectFromExposedRect:unobscuredRect scale:scale];
    183             drawingArea->setCustomFixedPositionRect(fixedPosRect);
    184         }
     181    if (auto drawingArea = _page->drawingArea())
    185182        drawingArea->updateDebugIndicator();
    186     }
    187183}
    188184
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.h

    r165124 r165235  
    9292    virtual void setExposedRect(const WebCore::FloatRect&) = 0;
    9393    virtual WebCore::FloatRect exposedRect() const = 0;
    94     virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) = 0;
    9594#endif
    9695#if PLATFORM(IOS)
  • trunk/Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in

    r164192 r165235  
    3131    SetColorSpace(WebKit::ColorSpaceData colorSpace)
    3232    SetExposedRect(WebCore::FloatRect exposedRect)
    33     SetCustomFixedPositionRect(WebCore::FloatRect fixedPositionRect)
    3433
    3534    AdjustTransientZoom(double scale, WebCore::FloatPoint origin)
  • trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm

    r165124 r165235  
    17471747
    17481748    m_page->mainFrame().view()->setScrollOffset(scrollPosition);
     1749   
     1750    if (visibleContentRectUpdateInfo.inStableState())
     1751        m_page->mainFrame().view()->setCustomFixedPositionLayoutRect(enclosingIntRect(visibleContentRectUpdateInfo.customFixedPositionRect()));
     1752
    17491753    // FIXME: we should also update the frame view from unobscured rect. Altenatively, we can have it pull the values from ScrollView.
    17501754}
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h

    r165124 r165235  
    8080#endif
    8181
    82     virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) override;
    83 
    8482    // WebCore::GraphicsLayerClient
    8583    virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) override { }
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm

    r165124 r165235  
    284284}
    285285
    286 void RemoteLayerTreeDrawingArea::setCustomFixedPositionRect(const FloatRect& fixedPositionRect)
    287 {
    288 #if PLATFORM(IOS)
    289     FrameView* frameView = m_webPage->corePage()->mainFrame().view();
    290     if (!frameView)
    291         return;
    292 
    293     frameView->setCustomFixedPositionLayoutRect(enclosingIntRect(fixedPositionRect));
    294 #endif
    295 }
    296 
    297286TiledBacking* RemoteLayerTreeDrawingArea::mainFrameTiledBacking() const
    298287{
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h

    r164337 r165235  
    8383    virtual WebCore::FloatRect exposedRect() const override { return m_scrolledExposedRect; }
    8484
    85     virtual void setCustomFixedPositionRect(const WebCore::FloatRect&) override { }
    86 
    8785    virtual bool supportsAsyncScrolling() override { return true; }
    8886
Note: See TracChangeset for help on using the changeset viewer.