Changeset 106723 in webkit


Ignore:
Timestamp:
Feb 3, 2012 5:56:42 PM (12 years ago)
Author:
andersca@apple.com
Message:

WebKit2 should dispatch wheel events to the new ScrollingTree class
https://bugs.webkit.org/show_bug.cgi?id=77795

Reviewed by Andreas Kling.

Source/WebCore:

  • WebCore.exp.in:

Add new symbols needed by WebKit2.

  • WebCore.xcodeproj/project.pbxproj:

Make ScrollingTree.h private so it can be included by WebKit2.

  • page/scrolling/ScrollingCoordinator.cpp:

(WebCore::ScrollingCoordinator::scrollingTree):

  • page/scrolling/ScrollingCoordinator.h:

Add a scrolling tree getter.

Source/WebKit2:

Replace all uses of ScrollingCoordinator with ScrollingTree instead.
Also, don't try to handle gesture events on the scrolling thread anymore;
we don't need to to that right now.

  • WebProcess/WebPage/EventDispatcher.cpp:

(WebKit::EventDispatcher::addScrollingTreeForPage):
(WebKit::EventDispatcher::removeScrollingTreeForPage):
(WebKit::EventDispatcher::wheelEvent):
(WebKit::EventDispatcher::gestureEvent):

  • WebProcess/WebPage/EventDispatcher.h:

(WebCore):
(EventDispatcher):

  • WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:

(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106722 r106723  
     12012-02-03  Anders Carlsson  <andersca@apple.com>
     2
     3        WebKit2 should dispatch wheel events to the new ScrollingTree class
     4        https://bugs.webkit.org/show_bug.cgi?id=77795
     5
     6        Reviewed by Andreas Kling.
     7
     8        * WebCore.exp.in:
     9        Add new symbols needed by WebKit2.
     10
     11        * WebCore.xcodeproj/project.pbxproj:
     12        Make ScrollingTree.h private so it can be included by WebKit2.
     13
     14        * page/scrolling/ScrollingCoordinator.cpp:
     15        (WebCore::ScrollingCoordinator::scrollingTree):
     16        * page/scrolling/ScrollingCoordinator.h:
     17        Add a scrolling tree getter.
     18
    1192012-02-03  Dmitry Lomov  <dslomov@google.com>
    220
  • trunk/Source/WebCore/WebCore.exp.in

    r106706 r106723  
    20672067
    20682068#if ENABLE(THREADED_SCROLLING)
     2069__ZN7WebCore13ScrollingTree21tryToHandleWheelEventERKNS_18PlatformWheelEventE
     2070__ZN7WebCore13ScrollingTreeD1Ev
    20692071__ZN7WebCore20ScrollingCoordinator16handleWheelEventERKNS_18PlatformWheelEventE
    20702072__ZN7WebCore20ScrollingCoordinatorD1Ev
    20712073__ZN7WebCore4Page20scrollingCoordinatorEv
     2074__ZNK7WebCore20ScrollingCoordinator13scrollingTreeEv
    20722075
    20732076#if ENABLE(GESTURE_EVENTS)
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r106696 r106723  
    490490                1AA8799011CBE846003C664F /* PluginStrategy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA8798F11CBE846003C664F /* PluginStrategy.h */; settings = {ATTRIBUTES = (Private, ); }; };
    491491                1AAADDA314DB409F00AF64B3 /* ScrollingTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDA114DB409F00AF64B3 /* ScrollingTree.cpp */; };
    492                 1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; };
     492                1AAADDA414DB409F00AF64B3 /* ScrollingTree.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDA214DB409F00AF64B3 /* ScrollingTree.h */; settings = {ATTRIBUTES = (Private, ); }; };
    493493                1AAADDBE14DC640700AF64B3 /* ScrollingTreeState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AAADDBC14DC640600AF64B3 /* ScrollingTreeState.cpp */; };
    494494                1AAADDBF14DC640700AF64B3 /* ScrollingTreeState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AAADDBD14DC640600AF64B3 /* ScrollingTreeState.h */; };
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp

    r106696 r106723  
    7474}
    7575
     76ScrollingTree* ScrollingCoordinator::scrollingTree() const
     77{
     78    ASSERT(m_scrollingTree);
     79    return m_scrollingTree.get();
     80}
     81
    7682bool ScrollingCoordinator::coordinatesScrollingForFrameView(FrameView* frameView) const
    7783{
  • trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h

    r106690 r106723  
    5959
    6060    void pageDestroyed();
     61
     62    ScrollingTree* scrollingTree() const;
    6163
    6264    // Return whether this scrolling coordinator handles scrolling for the given frame view.
  • trunk/Source/WebKit2/ChangeLog

    r106717 r106723  
     12012-02-03  Anders Carlsson  <andersca@apple.com>
     2
     3        WebKit2 should dispatch wheel events to the new ScrollingTree class
     4        https://bugs.webkit.org/show_bug.cgi?id=77795
     5
     6        Reviewed by Andreas Kling.
     7
     8        Replace all uses of ScrollingCoordinator with ScrollingTree instead.
     9        Also, don't try to handle gesture events on the scrolling thread anymore;
     10        we don't need to to that right now.
     11
     12        * WebProcess/WebPage/EventDispatcher.cpp:
     13        (WebKit::EventDispatcher::addScrollingTreeForPage):
     14        (WebKit::EventDispatcher::removeScrollingTreeForPage):
     15        (WebKit::EventDispatcher::wheelEvent):
     16        (WebKit::EventDispatcher::gestureEvent):
     17        * WebProcess/WebPage/EventDispatcher.h:
     18        (WebCore):
     19        (EventDispatcher):
     20        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
     21        (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
     22        (WebKit::TiledCoreAnimationDrawingArea::~TiledCoreAnimationDrawingArea):
     23
    1242012-02-03  Alexey Proskuryakov  <ap@apple.com>
    225
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.cpp

    r105475 r106723  
    3838#if ENABLE(THREADED_SCROLLING)
    3939#include <WebCore/ScrollingCoordinator.h>
     40#include <WebCore/ScrollingTree.h>
    4041#endif
    4142
     
    5354
    5455#if ENABLE(THREADED_SCROLLING)
    55 void EventDispatcher::addScrollingCoordinatorForPage(WebPage* webPage)
     56void EventDispatcher::addScrollingTreeForPage(WebPage* webPage)
    5657{
    57     MutexLocker locker(m_scrollingCoordinatorsMutex);
     58    MutexLocker locker(m_scrollingTreesMutex);
    5859
    5960    ASSERT(webPage->corePage()->scrollingCoordinator());
    60     ASSERT(!m_scrollingCoordinators.contains(webPage->pageID()));
    61     m_scrollingCoordinators.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator());
     61    ASSERT(!m_scrollingTrees.contains(webPage->pageID()));
     62    m_scrollingTrees.set(webPage->pageID(), webPage->corePage()->scrollingCoordinator()->scrollingTree());
    6263}
    6364
    64 void EventDispatcher::removeScrollingCoordinatorForPage(WebPage* webPage)
     65void EventDispatcher::removeScrollingTreeForPage(WebPage* webPage)
    6566{
    66     MutexLocker locker(m_scrollingCoordinatorsMutex);
    67     ASSERT(m_scrollingCoordinators.contains(webPage->pageID()));
     67    MutexLocker locker(m_scrollingTreesMutex);
     68    ASSERT(m_scrollingTrees.contains(webPage->pageID()));
    6869
    69     m_scrollingCoordinators.remove(webPage->pageID());
     70    m_scrollingTrees.remove(webPage->pageID());
    7071}
    7172#endif
     
    8283{
    8384#if ENABLE(THREADED_SCROLLING)
    84     MutexLocker locker(m_scrollingCoordinatorsMutex);
    85     if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) {
     85    MutexLocker locker(m_scrollingTreesMutex);
     86    if (ScrollingTree* scrollingTree = m_scrollingTrees.get(pageID).get()) {
    8687        PlatformWheelEvent platformWheelEvent = platform(wheelEvent);
    8788
    88         if (scrollingCoordinator->handleWheelEvent(platformWheelEvent)) {
     89        if (scrollingTree->tryToHandleWheelEvent(platformWheelEvent)) {
    8990            sendDidHandleEvent(pageID, wheelEvent);
    9091            return;
     
    99100void EventDispatcher::gestureEvent(CoreIPC::Connection*, uint64_t pageID, const WebGestureEvent& gestureEvent)
    100101{
    101 #if ENABLE(THREADED_SCROLLING)
    102     MutexLocker locker(m_scrollingCoordinatorsMutex);
    103     if (ScrollingCoordinator* scrollingCoordinator = m_scrollingCoordinators.get(pageID).get()) {
    104         PlatformGestureEvent platformGestureEvent = platform(gestureEvent);
    105 
    106         if (scrollingCoordinator->handleGestureEvent(platformGestureEvent)) {
    107             sendDidHandleEvent(pageID, gestureEvent);
    108             return;
    109         }
    110     }
    111 #endif
    112 
    113102    RunLoop::main()->dispatch(bind(&EventDispatcher::dispatchGestureEvent, this, pageID, gestureEvent));
    114103}
  • trunk/Source/WebKit2/WebProcess/WebPage/EventDispatcher.h

    r104623 r106723  
    3434
    3535namespace WebCore {
    36     class ScrollingCoordinator;
     36    class ScrollingTree;
    3737}
    3838
     
    5555
    5656#if ENABLE(THREADED_SCROLLING)
    57     void addScrollingCoordinatorForPage(WebPage*);
    58     void removeScrollingCoordinatorForPage(WebPage*);
     57    void addScrollingTreeForPage(WebPage*);
     58    void removeScrollingTreeForPage(WebPage*);
    5959#endif
    6060
     
    8181    void sendDidHandleEvent(uint64_t pageID, const WebEvent&);
    8282
    83     Mutex m_scrollingCoordinatorsMutex;
    84     HashMap<uint64_t, RefPtr<WebCore::ScrollingCoordinator> > m_scrollingCoordinators;
     83    Mutex m_scrollingTreesMutex;
     84    HashMap<uint64_t, RefPtr<WebCore::ScrollingTree> > m_scrollingTrees;
    8585#endif
    8686};
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

    r105008 r106723  
    6767    page->settings()->setScrollingCoordinatorEnabled(true);
    6868
    69     WebProcess::shared().eventDispatcher().addScrollingCoordinatorForPage(webPage);
     69    WebProcess::shared().eventDispatcher().addScrollingTreeForPage(webPage);
    7070#endif
    7171
     
    8989{
    9090#if ENABLE(THREADED_SCROLLING)
    91     WebProcess::shared().eventDispatcher().removeScrollingCoordinatorForPage(m_webPage);
     91    WebProcess::shared().eventDispatcher().removeScrollingTreeForPage(m_webPage);
    9292#endif
    9393
Note: See TracChangeset for help on using the changeset viewer.