Changeset 161373 in webkit


Ignore:
Timestamp:
Jan 6, 2014 2:19:42 PM (10 years ago)
Author:
Simon Fraser
Message:

Add new files for UI-side scrolling
https://bugs.webkit.org/show_bug.cgi?id=126532

Source/WebCore:

Reviewed by Anders Carlson.

  • WebCore.xcodeproj/project.pbxproj: Make lots of scrolling-related headers Private

so WebKit2 can include them.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::scheduleUpdateScrollPositionForNode): Callback that
indicates that the given node has been scrolled asynchronously. Currently only
handles the main frame.

  • page/scrolling/ScrollingCoordinator.h: Add support for type-casts of a remote subclass

in another namespace.
(WebCore::ScrollingCoordinator::isRemoteScrollingCoordinator):

  • page/scrolling/ScrollingTree.h:

(WebCore::ScrollingTree::isRemoteScrollingTree):

Source/WebKit2:

Reviewed by Anders Carlson.

Add RemoteScrollingCoordinator, RemoteScrollingCoordinatorProxy,
RemoteScrollingCoordinatorTransaction, RemoteScrollingTree.

These allow the scrolling tree to be used in the UI process.
RemoteScrollingCoordinator builds a ScrollingStateTree, which is
encoded by RemoteScrollingCoordinatorTransaction. Decoding the
transaction recreates that ScrollingStateTree in the UI process,
and RemoteScrollingCoordinatorProxy "commits" that to update
the RemoteScrollingTree.

New classes are not hooked up to anything yet.

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: Added.

(ArgumentCoder<ScrollingStateNode>::encode):
(ArgumentCoder<ScrollingStateNode>::decode):
(ArgumentCoder<ScrollingStateScrollingNode>::encode):
(ArgumentCoder<ScrollingStateScrollingNode>::decode):
(ArgumentCoder<ScrollingStateFixedNode>::encode):
(ArgumentCoder<ScrollingStateFixedNode>::decode):
(ArgumentCoder<ScrollingStateStickyNode>::encode):
(ArgumentCoder<ScrollingStateStickyNode>::decode):
(WebKit::encodeNodeAndDescendants):
(WebKit::RemoteScrollingCoordinatorTransaction::encode):
(WebKit::RemoteScrollingCoordinatorTransaction::decode):

  • Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: Added.

(WebKit::RemoteScrollingCoordinatorTransaction::setStateTreeToEncode):
(WebKit::RemoteScrollingCoordinatorTransaction::scrollingStateTree):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Added.

(WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
(WebKit::RemoteScrollingCoordinatorProxy::~RemoteScrollingCoordinatorProxy):
(WebKit::RemoteScrollingCoordinatorProxy::layerTreeHost):
(WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
(WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):

  • UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: Added.
  • UIProcess/Scrolling/RemoteScrollingTree.cpp: Added.

(WebKit::RemoteScrollingTree::create):
(WebKit::RemoteScrollingTree::RemoteScrollingTree):
(WebKit::RemoteScrollingTree::~RemoteScrollingTree):
(WebKit::RemoteScrollingTree::tryToHandleWheelEvent):
(WebKit::RemoteScrollingTree::handleWheelEventPhase):
(WebKit::RemoteScrollingTree::updateMainFrameScrollPosition):
(WebKit::RemoteScrollingTree::createNode):

  • UIProcess/Scrolling/RemoteScrollingTree.h: Added.

(WebKit::RemoteScrollingTree::scrollingCoordinatorProxy):

  • WebKit2.xcodeproj/project.pbxproj:
  • WebProcess/Scrolling/RemoteScrollingCoordinator.h: Added.

(WebKit::RemoteScrollingCoordinator::create):

  • WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: Added.
  • WebProcess/Scrolling/RemoteScrollingCoordinator.mm: Added.

(WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
(WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
(WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
(WebKit::RemoteScrollingCoordinator::createScrollingTreeNode):
(WebKit::RemoteScrollingCoordinator::isRubberBandInProgress):
(WebKit::RemoteScrollingCoordinator::setScrollPinningBehavior):
(WebKit::RemoteScrollingCoordinator::buildTransaction):
(WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):

Location:
trunk/Source
Files:
10 added
8 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r161357 r161373  
     12014-01-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add new files for UI-side scrolling
     4        https://bugs.webkit.org/show_bug.cgi?id=126532
     5
     6        Reviewed by Anders Carlson.
     7
     8        * WebCore.xcodeproj/project.pbxproj: Make lots of scrolling-related headers Private
     9        so WebKit2 can include them.
     10        * page/scrolling/ScrollingCoordinator.cpp:
     11        (WebCore::ScrollingCoordinator::scheduleUpdateScrollPositionForNode): Callback that
     12        indicates that the given node has been scrolled asynchronously. Currently only
     13        handles the main frame.
     14        * page/scrolling/ScrollingCoordinator.h: Add support for type-casts of a remote subclass
     15        in another namespace.
     16        (WebCore::ScrollingCoordinator::isRemoteScrollingCoordinator):
     17        * page/scrolling/ScrollingTree.h:
     18        (WebCore::ScrollingTree::isRemoteScrollingTree):
     19
    1202014-01-06  Gavin Barraclough  <barraclough@apple.com>
    221
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r161357 r161373  
    477477                0FA24D7A162DF91900A3F4C0 /* GraphicsLayerUpdater.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FA24D78162DF91900A3F4C0 /* GraphicsLayerUpdater.h */; settings = {ATTRIBUTES = (Private, ); }; };
    478478                0FA88EBD16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FA88EBC16A8D1BD00F99984 /* ScrollingStateScrollingNodeMac.mm */; };
    479                 0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */; };
     479                0FB8890A167D2FA10010CDA5 /* ScrollingTreeStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB88908167D2FA10010CDA5 /* ScrollingTreeStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    480480                0FB8890B167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FB88909167D2FA10010CDA5 /* ScrollingTreeStickyNode.mm */; };
    481481                0FB8890E167D30160010CDA5 /* ScrollingStateStickyNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FB8890C167D30160010CDA5 /* ScrollingStateStickyNode.cpp */; };
    482                 0FB8890F167D30160010CDA5 /* ScrollingStateStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */; };
     482                0FB8890F167D30160010CDA5 /* ScrollingStateStickyNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB8890D167D30160010CDA5 /* ScrollingStateStickyNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    483483                0FCF33240F2B9715004B6795 /* ColorCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF33230F2B9715004B6795 /* ColorCG.cpp */; };
    484484                0FCF332E0F2B9A25004B6795 /* WebLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCF332A0F2B9A25004B6795 /* WebLayer.mm */; };
     
    710710                1AA7160B149BC4DB0016EC19 /* TileController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA71609149BC4DB0016EC19 /* TileController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    711711                1AA84F04143BA7BD0051D153 /* ScrollElasticityController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA84F02143BA7BD0051D153 /* ScrollElasticityController.mm */; };
    712                 1AA84F05143BA7BD0051D153 /* ScrollElasticityController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA84F03143BA7BD0051D153 /* ScrollElasticityController.h */; };
     712                1AA84F05143BA7BD0051D153 /* ScrollElasticityController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA84F03143BA7BD0051D153 /* ScrollElasticityController.h */; settings = {ATTRIBUTES = (Private, ); }; };
    713713                1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    714714                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */; };
    715715                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
    716716                1AAADDE314DC8C8F00AF64B3 /* ScrollingTreeNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDE114DC8C8F00AF64B3 /* ScrollingTreeNode.cpp */; };
    717                 1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */; };
     717                1AAADDE414DC8C8F00AF64B3 /* ScrollingTreeNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDE214DC8C8F00AF64B3 /* ScrollingTreeNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    718718                1AB09DB416AF5F6C008538E7 /* StorageStrategy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AB09DB216AF5F6C008538E7 /* StorageStrategy.cpp */; };
    719719                1AB09DB516AF5F6C008538E7 /* StorageStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AB09DB316AF5F6C008538E7 /* StorageStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    30753075                9391A991162746CB00297330 /* ScrollingCoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A990162746CB00297330 /* ScrollingCoordinatorMac.h */; };
    30763076                9391A99C1629D70000297330 /* ScrollingTreeScrollingNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9391A99A1629D6FF00297330 /* ScrollingTreeScrollingNode.cpp */; };
    3077                 9391A99D1629D70000297330 /* ScrollingTreeScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */; };
     3077                9391A99D1629D70000297330 /* ScrollingTreeScrollingNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A99B1629D70000297330 /* ScrollingTreeScrollingNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    30783078                9392262D1032107B006E7D5D /* JSHTMLCanvasElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392262C1032107B006E7D5D /* JSHTMLCanvasElementCustom.cpp */; };
    30793079                9392262F10321084006E7D5D /* JSCSSRuleListCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9392262E10321084006E7D5D /* JSCSSRuleListCustom.cpp */; };
     
    31103110                93C09C860B0657AA005ABD4D /* ScrollTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C09C850B0657AA005ABD4D /* ScrollTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
    31113111                93C38BFE164473C700091EB2 /* ScrollingStateFixedNode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 93C38BFC164473C700091EB2 /* ScrollingStateFixedNode.cpp */; };
    3112                 93C38BFF164473C700091EB2 /* ScrollingStateFixedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C38BFD164473C700091EB2 /* ScrollingStateFixedNode.h */; };
    3113                 93C38C03164473DD00091EB2 /* ScrollingTreeFixedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C38C01164473DD00091EB2 /* ScrollingTreeFixedNode.h */; };
     3112                93C38BFF164473C700091EB2 /* ScrollingStateFixedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C38BFD164473C700091EB2 /* ScrollingStateFixedNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
     3113                93C38C03164473DD00091EB2 /* ScrollingTreeFixedNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C38C01164473DD00091EB2 /* ScrollingTreeFixedNode.h */; settings = {ATTRIBUTES = (Private, ); }; };
    31143114                93C38C04164473DD00091EB2 /* ScrollingTreeFixedNode.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C38C02164473DD00091EB2 /* ScrollingTreeFixedNode.mm */; };
    31153115                93C442000F813AE100C1A634 /* CollectionType.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C441FF0F813AE100C1A634 /* CollectionType.h */; settings = {ATTRIBUTES = (Private, ); }; };
    3116                 93C4A4151629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4A4131629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h */; };
     3116                93C4A4151629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4A4131629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
    31173117                93C4A4161629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 93C4A4141629DF5A00C3EB6E /* ScrollingTreeScrollingNodeMac.mm */; };
    31183118                93C4F6EB1108F9A50099D0DB /* AccessibilityScrollbar.h in Headers */ = {isa = PBXBuildFile; fileRef = 93C4F6E91108F9A50099D0DB /* AccessibilityScrollbar.h */; };
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r160944 r161373  
    275275}
    276276
     277void ScrollingCoordinator::scheduleUpdateScrollPositionForNode(ScrollingNodeID, const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
     278{
     279    // FIXME: need to handle non-main nodes.
     280    scheduleUpdateMainFrameScrollPosition(scrollPosition, programmaticScroll, scrollingLayerPositionAction);
     281}
     282
    277283void ScrollingCoordinator::scheduleUpdateMainFrameScrollPosition(const IntPoint& scrollPosition, bool programmaticScroll, SetOrSyncScrollingLayerPosition scrollingLayerPositionAction)
    278284{
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r161212 r161373  
    109109   
    110110    virtual bool isAsyncScrollingCoordinator() const { return false; }
     111    virtual bool isRemoteScrollingCoordinator() const { return false; }
    111112
    112113    // Return whether this scrolling coordinator handles scrolling for the given frame view.
     
    159160    ScrollingNodeID uniqueScrollLayerID();
    160161
     162    void scheduleUpdateScrollPositionForNode(ScrollingNodeID, const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);
     163
    161164    // Dispatched by the scrolling tree whenever the main frame scroll position changes.
    162165    void scheduleUpdateMainFrameScrollPosition(const IntPoint&, bool programmaticScroll, SetOrSyncScrollingLayerPosition);
     
    199202    GraphicsLayer* footerLayerForFrameView(FrameView*);
    200203
    201     Page* m_page;
     204    Page* m_page; // FIXME: ideally this would be a reference but it gets nulled on async teardown.
    202205
    203206private:
     
    219222
    220223#define SCROLLING_COORDINATOR_TYPE_CASTS(ToValueTypeName, predicate) \
    221     TYPE_CASTS_BASE(ToValueTypeName, ScrollingCoordinator, value, value->predicate, value.predicate)
     224    TYPE_CASTS_BASE(ToValueTypeName, WebCore::ScrollingCoordinator, value, value->predicate, value.predicate)
    222225
    223226} // namespace WebCore
  • trunk/Source/WebCore/page/scrolling/ScrollingTree.h

    r161276 r161373  
    5858   
    5959    virtual bool isThreadedScrollingTree() const { return false; }
     60    virtual bool isRemoteScrollingTree() const { return false; }
    6061
    6162    virtual EventResult tryToHandleWheelEvent(const PlatformWheelEvent&) = 0;
     
    134135
    135136#define SCROLLING_TREE_TYPE_CASTS(ToValueTypeName, predicate) \
    136     TYPE_CASTS_BASE(ToValueTypeName, ScrollingTree, value, value->predicate, value.predicate)
     137    TYPE_CASTS_BASE(ToValueTypeName, WebCore::ScrollingTree, value, value->predicate, value.predicate)
    137138
    138139} // namespace WebCore
  • trunk/Source/WebKit2/ChangeLog

    r161368 r161373  
     12014-01-06  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Rename DrawingArea::supportsThreadedScrolling() to supportsAsyncScrolling()
     4        https://bugs.webkit.org/show_bug.cgi?id=126529
     5
     6        Reviewed by Tim Horton.
     7       
     8        Change function name from using "threaded" to "async" terminology.
     9
     10        * WebProcess/WebPage/DrawingArea.h:
     11        (WebKit::DrawingArea::supportsAsyncScrolling):
     12        * WebProcess/WebPage/WebPage.cpp:
     13        (WebKit::WebPage::WebPage):
     14        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
     15
     162014-01-06  Simon Fraser  <simon.fraser@apple.com>
     17
     18        Add new files for UI-side scrolling
     19        https://bugs.webkit.org/show_bug.cgi?id=126532
     20
     21        Reviewed by Anders Carlson.
     22       
     23        Add RemoteScrollingCoordinator, RemoteScrollingCoordinatorProxy,
     24        RemoteScrollingCoordinatorTransaction, RemoteScrollingTree.
     25       
     26        These allow the scrolling tree to be used in the UI process.
     27        RemoteScrollingCoordinator builds a ScrollingStateTree, which is
     28        encoded by RemoteScrollingCoordinatorTransaction. Decoding the
     29        transaction recreates that ScrollingStateTree in the UI process,
     30        and RemoteScrollingCoordinatorProxy "commits" that to update
     31        the RemoteScrollingTree.
     32       
     33        New classes are not hooked up to anything yet.
     34
     35        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp: Added.
     36        (ArgumentCoder<ScrollingStateNode>::encode):
     37        (ArgumentCoder<ScrollingStateNode>::decode):
     38        (ArgumentCoder<ScrollingStateScrollingNode>::encode):
     39        (ArgumentCoder<ScrollingStateScrollingNode>::decode):
     40        (ArgumentCoder<ScrollingStateFixedNode>::encode):
     41        (ArgumentCoder<ScrollingStateFixedNode>::decode):
     42        (ArgumentCoder<ScrollingStateStickyNode>::encode):
     43        (ArgumentCoder<ScrollingStateStickyNode>::decode):
     44        (WebKit::encodeNodeAndDescendants):
     45        (WebKit::RemoteScrollingCoordinatorTransaction::encode):
     46        (WebKit::RemoteScrollingCoordinatorTransaction::decode):
     47        * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h: Added.
     48        (WebKit::RemoteScrollingCoordinatorTransaction::setStateTreeToEncode):
     49        (WebKit::RemoteScrollingCoordinatorTransaction::scrollingStateTree):
     50        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp: Added.
     51        (WebKit::RemoteScrollingCoordinatorProxy::RemoteScrollingCoordinatorProxy):
     52        (WebKit::RemoteScrollingCoordinatorProxy::~RemoteScrollingCoordinatorProxy):
     53        (WebKit::RemoteScrollingCoordinatorProxy::layerTreeHost):
     54        (WebKit::RemoteScrollingCoordinatorProxy::updateScrollingTree):
     55        (WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
     56        (WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
     57        (WebKit::RemoteScrollingCoordinatorProxy::scrollPositionChanged):
     58        * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h: Added.
     59        * UIProcess/Scrolling/RemoteScrollingTree.cpp: Added.
     60        (WebKit::RemoteScrollingTree::create):
     61        (WebKit::RemoteScrollingTree::RemoteScrollingTree):
     62        (WebKit::RemoteScrollingTree::~RemoteScrollingTree):
     63        (WebKit::RemoteScrollingTree::tryToHandleWheelEvent):
     64        (WebKit::RemoteScrollingTree::handleWheelEventPhase):
     65        (WebKit::RemoteScrollingTree::updateMainFrameScrollPosition):
     66        (WebKit::RemoteScrollingTree::createNode):
     67        * UIProcess/Scrolling/RemoteScrollingTree.h: Added.
     68        (WebKit::RemoteScrollingTree::scrollingCoordinatorProxy):
     69        * WebKit2.xcodeproj/project.pbxproj:
     70        * WebProcess/Scrolling/RemoteScrollingCoordinator.h: Added.
     71        (WebKit::RemoteScrollingCoordinator::create):
     72        * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: Added.
     73        * WebProcess/Scrolling/RemoteScrollingCoordinator.mm: Added.
     74        (WebKit::RemoteScrollingCoordinator::RemoteScrollingCoordinator):
     75        (WebKit::RemoteScrollingCoordinator::~RemoteScrollingCoordinator):
     76        (WebKit::RemoteScrollingCoordinator::scheduleTreeStateCommit):
     77        (WebKit::RemoteScrollingCoordinator::createScrollingTreeNode):
     78        (WebKit::RemoteScrollingCoordinator::isRubberBandInProgress):
     79        (WebKit::RemoteScrollingCoordinator::setScrollPinningBehavior):
     80        (WebKit::RemoteScrollingCoordinator::buildTransaction):
     81        (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
     82
    1832014-01-06  Martin Robinson  <mrobinson@igalia.com>
    284
  • trunk/Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.h

    r161371 r161373  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef RemoteLayerTreeDrawingAreaProxy_h
    27 #define RemoteLayerTreeDrawingAreaProxy_h
     26#ifndef RemoteScrollingCoordinatorTransaction_h
     27#define RemoteScrollingCoordinatorTransaction_h
    2828
    29 #include "DrawingAreaProxy.h"
    30 #include "RemoteLayerTreeHost.h"
    31 #include <WebCore/IntPoint.h>
    32 #include <WebCore/IntSize.h>
     29#include <WebCore/ScrollingStateTree.h>
     30#include <wtf/OwnPtr.h>
     31#include <wtf/PassOwnPtr.h>
     32
     33namespace IPC {
     34class ArgumentDecoder;
     35class ArgumentEncoder;
     36}
    3337
    3438namespace WebKit {
    3539
    36 class RemoteLayerTreeTransaction;
     40class RemoteScrollingCoordinatorTransaction {
     41public:
     42    void setStateTreeToEncode(PassOwnPtr<WebCore::ScrollingStateTree> stateTree) { m_scrollingStateTree = stateTree; }
     43    OwnPtr<WebCore::ScrollingStateTree>& scrollingStateTree() { return m_scrollingStateTree; }
     44   
     45    void encode(IPC::ArgumentEncoder&) const;
     46    static bool decode(IPC::ArgumentDecoder&, RemoteScrollingCoordinatorTransaction&);
    3747
    38 class RemoteLayerTreeDrawingAreaProxy : public DrawingAreaProxy {
    39 public:
    40     explicit RemoteLayerTreeDrawingAreaProxy(WebPageProxy*);
    41     virtual ~RemoteLayerTreeDrawingAreaProxy();
    42 
    43     const RemoteLayerTreeHost& remoteLayerTreeHost() const { return m_remoteLayerTreeHost; }
     48private:
     49    bool decode(IPC::ArgumentDecoder&);
    4450   
    45 private:
    46     virtual void sizeDidChange() OVERRIDE;
    47     virtual void deviceScaleFactorDidChange() OVERRIDE;
    48     virtual void didUpdateGeometry() OVERRIDE;
    49 
    50     // CoreIPC::MessageReceiver
    51     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) OVERRIDE;
    52 
    53     // Message handlers
    54     void commitLayerTree(const RemoteLayerTreeTransaction&);
    55    
    56     void sendUpdateGeometry();
    57 
    58     RemoteLayerTreeHost m_remoteLayerTreeHost;
    59     bool m_isWaitingForDidUpdateGeometry;
    60 
    61     WebCore::IntSize m_lastSentSize;
    62     WebCore::IntSize m_lastSentLayerPosition;
     51    OwnPtr<WebCore::ScrollingStateTree> m_scrollingStateTree;
    6352};
    6453
    6554} // namespace WebKit
    6655
    67 #endif // RemoteLayerTreeDrawingAreaProxy_h
     56#endif // RemoteScrollingCoordinatorTransaction_h
  • trunk/Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h

    r161371 r161373  
    11/*
    2  * Copyright (C) 2012 Apple Inc. All rights reserved.
     2 * Copyright (C) 2014 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2424 */
    2525
    26 #ifndef RemoteLayerTreeDrawingAreaProxy_h
    27 #define RemoteLayerTreeDrawingAreaProxy_h
     26#ifndef RemoteScrollingCoordinatorProxy_h
     27#define RemoteScrollingCoordinatorProxy_h
    2828
    29 #include "DrawingAreaProxy.h"
    30 #include "RemoteLayerTreeHost.h"
    31 #include <WebCore/IntPoint.h>
    32 #include <WebCore/IntSize.h>
     29#include "MessageReceiver.h"
     30#include "RemoteScrollingCoordinator.h"
     31#include <wtf/Noncopyable.h>
     32#include <wtf/RefPtr.h>
     33
     34namespace WebCore {
     35class FloatPoint;
     36class PlatformWheelEvent;
     37}
    3338
    3439namespace WebKit {
    3540
    36 class RemoteLayerTreeTransaction;
     41class RemoteLayerTreeHost;
     42class RemoteScrollingCoordinatorTransaction;
     43class RemoteScrollingTree;
     44class WebPageProxy;
    3745
    38 class RemoteLayerTreeDrawingAreaProxy : public DrawingAreaProxy {
     46class RemoteScrollingCoordinatorProxy {
     47    WTF_MAKE_NONCOPYABLE(RemoteScrollingCoordinatorProxy);
    3948public:
    40     explicit RemoteLayerTreeDrawingAreaProxy(WebPageProxy*);
    41     virtual ~RemoteLayerTreeDrawingAreaProxy();
     49    explicit RemoteScrollingCoordinatorProxy(WebPageProxy&);
     50    virtual ~RemoteScrollingCoordinatorProxy();
     51   
     52    // Inform the web process that the scroll position changed.
     53    void scrollPositionChanged(WebCore::ScrollingNodeID, const WebCore::FloatPoint& newScrollPosition);
    4254
    43     const RemoteLayerTreeHost& remoteLayerTreeHost() const { return m_remoteLayerTreeHost; }
     55    // FIXME: expose the tree and pass this to that?
     56    bool handleWheelEvent(const WebCore::PlatformWheelEvent&);
    4457   
     58    WebCore::ScrollingNodeID rootScrollingNodeID() const;
     59
     60    const RemoteLayerTreeHost* layerTreeHost() const;
     61
     62    void updateScrollingTree(const RemoteScrollingCoordinatorTransaction&);
     63
    4564private:
    46     virtual void sizeDidChange() OVERRIDE;
    47     virtual void deviceScaleFactorDidChange() OVERRIDE;
    48     virtual void didUpdateGeometry() OVERRIDE;
     65    void connectStateNodeLayers(WebCore::ScrollingStateTree&, const RemoteLayerTreeHost&);
    4966
    50     // CoreIPC::MessageReceiver
    51     virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) OVERRIDE;
    52 
    53     // Message handlers
    54     void commitLayerTree(const RemoteLayerTreeTransaction&);
    55    
    56     void sendUpdateGeometry();
    57 
    58     RemoteLayerTreeHost m_remoteLayerTreeHost;
    59     bool m_isWaitingForDidUpdateGeometry;
    60 
    61     WebCore::IntSize m_lastSentSize;
    62     WebCore::IntSize m_lastSentLayerPosition;
     67    WebPageProxy& m_webPageProxy;
     68    RefPtr<RemoteScrollingTree> m_scrollingTree;
    6369};
    6470
    6571} // namespace WebKit
    6672
    67 #endif // RemoteLayerTreeDrawingAreaProxy_h
     73#endif // RemoteScrollingCoordinatorProxy_h
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h

    r161327 r161373  
    4848    virtual void didUpdateGeometry() OVERRIDE;
    4949
    50     // CoreIPC::MessageReceiver
     50    // IPC::MessageReceiver
    5151    virtual void didReceiveMessage(IPC::Connection*, IPC::MessageDecoder&) OVERRIDE;
    5252
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r161357 r161373  
    5050                0F174AA3142A4CB70039250F /* APIGeometry.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F174AA2142A4CB60039250F /* APIGeometry.h */; };
    5151                0F174AA7142AAC610039250F /* WKGeometry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F174AA6142AAC610039250F /* WKGeometry.cpp */; };
     52                0F594790187B3B3A00437857 /* RemoteScrollingCoordinator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F59478D187B3B3A00437857 /* RemoteScrollingCoordinator.h */; };
     53                0F594792187B3B3A00437857 /* RemoteScrollingCoordinator.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F59478F187B3B3A00437857 /* RemoteScrollingCoordinator.mm */; };
     54                0F59479A187B3B6000437857 /* RemoteScrollingCoordinatorProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F594794187B3B6000437857 /* RemoteScrollingCoordinatorProxy.cpp */; };
     55                0F59479B187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F594795187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h */; };
     56                0F59479C187B3B6000437857 /* RemoteScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F594796187B3B6000437857 /* RemoteScrollingTree.cpp */; };
     57                0F59479D187B3B6000437857 /* RemoteScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F594797187B3B6000437857 /* RemoteScrollingTree.h */; };
     58                0F5947A3187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F5947A1187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp */; };
     59                0F5947A4187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5947A2187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h */; };
    5260                0FB659231208B4DB0044816C /* DrawingAreaInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FB659221208B4DB0044816C /* DrawingAreaInfo.h */; };
    5361                0FF24A2D1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */; };
     
    15871595                0F174AA2142A4CB60039250F /* APIGeometry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIGeometry.h; sourceTree = "<group>"; };
    15881596                0F174AA6142AAC610039250F /* WKGeometry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKGeometry.cpp; sourceTree = "<group>"; };
     1597                0F59478D187B3B3A00437857 /* RemoteScrollingCoordinator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteScrollingCoordinator.h; path = Scrolling/RemoteScrollingCoordinator.h; sourceTree = "<group>"; };
     1598                0F59478E187B3B3A00437857 /* RemoteScrollingCoordinator.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = RemoteScrollingCoordinator.messages.in; path = Scrolling/RemoteScrollingCoordinator.messages.in; sourceTree = "<group>"; };
     1599                0F59478F187B3B3A00437857 /* RemoteScrollingCoordinator.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RemoteScrollingCoordinator.mm; path = Scrolling/RemoteScrollingCoordinator.mm; sourceTree = "<group>"; };
     1600                0F594794187B3B6000437857 /* RemoteScrollingCoordinatorProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RemoteScrollingCoordinatorProxy.cpp; path = Scrolling/RemoteScrollingCoordinatorProxy.cpp; sourceTree = "<group>"; };
     1601                0F594795187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteScrollingCoordinatorProxy.h; path = Scrolling/RemoteScrollingCoordinatorProxy.h; sourceTree = "<group>"; };
     1602                0F594796187B3B6000437857 /* RemoteScrollingTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RemoteScrollingTree.cpp; path = Scrolling/RemoteScrollingTree.cpp; sourceTree = "<group>"; };
     1603                0F594797187B3B6000437857 /* RemoteScrollingTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteScrollingTree.h; path = Scrolling/RemoteScrollingTree.h; sourceTree = "<group>"; };
     1604                0F5947A1187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RemoteScrollingCoordinatorTransaction.cpp; path = Scrolling/RemoteScrollingCoordinatorTransaction.cpp; sourceTree = "<group>"; };
     1605                0F5947A2187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RemoteScrollingCoordinatorTransaction.h; path = Scrolling/RemoteScrollingCoordinatorTransaction.h; sourceTree = "<group>"; };
    15891606                0FB659221208B4DB0044816C /* DrawingAreaInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaInfo.h; sourceTree = "<group>"; };
    15901607                0FF24A2B1879E4BC003ABF0C /* RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RemoteLayerTreeDrawingAreaProxyMessageReceiver.cpp; sourceTree = "<group>"; };
     
    32363253                        usesTabs = 0;
    32373254                };
     3255                0F59478C187B3B2A00437857 /* Scrolling */ = {
     3256                        isa = PBXGroup;
     3257                        children = (
     3258                                0F59478D187B3B3A00437857 /* RemoteScrollingCoordinator.h */,
     3259                                0F59478E187B3B3A00437857 /* RemoteScrollingCoordinator.messages.in */,
     3260                                0F59478F187B3B3A00437857 /* RemoteScrollingCoordinator.mm */,
     3261                        );
     3262                        name = Scrolling;
     3263                        sourceTree = "<group>";
     3264                };
     3265                0F594793187B3B4C00437857 /* Scrolling */ = {
     3266                        isa = PBXGroup;
     3267                        children = (
     3268                                0F594794187B3B6000437857 /* RemoteScrollingCoordinatorProxy.cpp */,
     3269                                0F594795187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h */,
     3270                                0F594796187B3B6000437857 /* RemoteScrollingTree.cpp */,
     3271                                0F594797187B3B6000437857 /* RemoteScrollingTree.h */,
     3272                        );
     3273                        name = Scrolling;
     3274                        sourceTree = "<group>";
     3275                };
     3276                0F5947A0187B3B7100437857 /* Scrolling */ = {
     3277                        isa = PBXGroup;
     3278                        children = (
     3279                                0F5947A1187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp */,
     3280                                0F5947A2187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h */,
     3281                        );
     3282                        name = Scrolling;
     3283                        sourceTree = "<group>";
     3284                };
    32383285                1058C7B0FEA5585E11CA2CBB /* Linked Frameworks */ = {
    32393286                        isa = PBXGroup;
     
    34973544                                51A8A60D1627F2AC000D90E9 /* Network */,
    34983545                                1AAE058C1279DCD400852418 /* Plugins */,
     3546                                0F5947A0187B3B7100437857 /* Scrolling */,
    34993547                                BC64696D11DBE603006455B0 /* APIArray.cpp */,
    35003548                                BC64696E11DBE603006455B0 /* APIArray.h */,
     
    44314479                                1A6FB7AA11E64B4900DB1371 /* Plugins */,
    44324480                                3336762B130C9978006C9DE2 /* ResourceCache */,
     4481                                0F59478C187B3B2A00437857 /* Scrolling */,
    44334482                                1AAC4DDE16B1CBF6009425E3 /* Storage */,
    44344483                                BC032D5D10F437220058C15A /* WebCoreSupport */,
     
    45484597                                31A2EC401489973700810D71 /* Notifications */,
    45494598                                1AEFCC0511D01F34008219D3 /* Plugins */,
     4599                                0F594793187B3B4C00437857 /* Scrolling */,
    45504600                                1A44B95816B73F8C00B7BBD8 /* Storage */,
    45514601                                BCF69FA11176D01400471A52 /* APINavigationData.cpp */,
     
    57385788                                1AEFD27911D16C81008219D3 /* ArgumentCoder.h in Headers */,
    57395789                                1AEFD2F711D1807B008219D3 /* ArgumentCoders.h in Headers */,
     5790                                0F59479D187B3B6000437857 /* RemoteScrollingTree.h in Headers */,
    57405791                                1AAF0C4A12B16334008E49E2 /* ArgumentCodersCF.h in Headers */,
    57415792                                E179FD9C134D38060015B883 /* ArgumentCodersMac.h in Headers */,
     
    59385989                                1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */,
    59395990                                1A8EFA711252B84100F7067F /* PluginProxyMessages.h in Headers */,
     5991                                0F594790187B3B3A00437857 /* RemoteScrollingCoordinator.h in Headers */,
    59405992                                1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */,
    59415993                                7CD622781739D863005BD7FF /* PluginSandboxProfile.h in Headers */,
     
    61096161                                371A19421824D29300F32A5E /* WKNSDictionary.h in Headers */,
    61106162                                33D3A3BB1339606200709BE4 /* WebMediaCacheManagerProxy.h in Headers */,
     6163                                0F5947A4187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.h in Headers */,
    61116164                                33D3A3CB1339617900709BE4 /* WebMediaCacheManagerProxyMessages.h in Headers */,
    61126165                                909854ED12BC4E18000AD080 /* WebMemorySampler.h in Headers */,
     
    61896242                                512A976A180E09B80039A149 /* DatabaseProcessProxyMessages.h in Headers */,
    61906243                                BC646C1B11DD399F006455B0 /* WKBackForwardListRef.h in Headers */,
     6244                                0F59479B187B3B6000437857 /* RemoteScrollingCoordinatorProxy.h in Headers */,
    61916245                                37C4C0951814B9E6003688B9 /* WKBackForwardListInternal.h in Headers */,
    61926246                                BC646C1D11DD399F006455B0 /* WKBackForwardListItemRef.h in Headers */,
     
    71887242                                659C551E130006410025C0C2 /* InjectedBundlePageResourceLoadClient.cpp in Sources */,
    71897243                                BCA8C6AF11E3C08700812FB7 /* InjectedBundlePageUIClient.cpp in Sources */,
     7244                                0F5947A3187B3B7D00437857 /* RemoteScrollingCoordinatorTransaction.cpp in Sources */,
    71907245                                BC33E0D212408E8600360F3F /* InjectedBundleRangeHandle.cpp in Sources */,
    71917246                                BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
     
    73137368                                1AB16ADD1648598400290D62 /* RemoteLayerTreeDrawingArea.mm in Sources */,
    73147369                                1AB16AE11648656D00290D62 /* RemoteLayerTreeDrawingAreaProxy.mm in Sources */,
     7370                                0F59479C187B3B6000437857 /* RemoteScrollingTree.cpp in Sources */,
    73157371                                1AA3D75B1651B44F008713D0 /* RemoteLayerTreeHost.mm in Sources */,
    73167372                                1AF1AC6B1651759E00C17D7F /* RemoteLayerTreeTransaction.mm in Sources */,
     
    76057661                                BC017D2016263308007054F5 /* WKDOMTextIterator.mm in Sources */,
    76067662                                1AB7D78E1288CD9A00CFD08C /* WKDownload.cpp in Sources */,
     7663                                0F594792187B3B3A00437857 /* RemoteScrollingCoordinator.mm in Sources */,
    76077664                                BC4075FB124FF0270068F20A /* WKError.cpp in Sources */,
    76087665                                BCFD548B132D82680055D816 /* WKErrorCF.cpp in Sources */,
     
    76237680                                51032F1D180F791700961BB7 /* DatabaseToWebProcessConnectionMessageReceiver.cpp in Sources */,
    76247681                                BCCF6AC212C91F34008F9C35 /* WKImage.cpp in Sources */,
     7682                                0F59479A187B3B6000437857 /* RemoteScrollingCoordinatorProxy.cpp in Sources */,
    76257683                                BCCF6AC912C91F59008F9C35 /* WKImageCG.cpp in Sources */,
    76267684                                1C8E293A12761E5B00BC7BD0 /* WKInspector.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.