[webkit-changes] [WebKit/WebKit] 83c11a: [UI-side compositing] Send wheel events to the scr...

Simon Fraser noreply at github.com
Mon Feb 27 19:27:07 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 83c11a0b9f7acd0feddc52a6e30689ebefa81c86
      https://github.com/WebKit/WebKit/commit/83c11a0b9f7acd0feddc52a6e30689ebefa81c86
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-02-27 (Mon, 27 Feb 2023)

  Changed paths:
    M Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
    M Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm

  Log Message:
  -----------
  [UI-side compositing] Send wheel events to the scrolling thread in the UI process
https://bugs.webkit.org/show_bug.cgi?id=253023
rdar://105992947

Reviewed by Tim Horton.

Start sending wheel events to the scrolling thread in the UI process. The primary
change is that RemoteScrollingCoordinatorProxyMac overrides handleWheelEvent()
to send events to m_wheelEventDispatcher, which bounces them to the scrolling thread.
RemoteScrollingCoordinatorProxyMac::displayDidRefresh() also forwards to
m_wheelEventDispatcher, but with a name that reflects that fact that this is the
"post-commit" displayDidRefresh() that always happens on the main thread.

RemoteScrollingTreeMac now has to bounce a number of scrolling tree callbacks back
to the main thread, and make sure that scroll animations that start as a result of
a scrolling tree commit on the main thread actually run on the scrolling thread.

Wire up RemoteLayerTreeEventDispatcher::hasNodeWithAnimatedScrollChanged() in order
to correctly keep a display link running while there are scroll animations.

Remove some code from RemoteScrollingCoordinatorProxyMac for functionality now
handled by RemoteLayerTreeEventDispatcher.

* Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h:
* Source/WebCore/page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::didCommitTreeOnScrollingThread): No need for clear(); we did a std::exchange() above.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::handleWheelEvent):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp:
(WebKit::RemoteLayerTreeEventDispatcher::hasNodeWithAnimatedScrollChanged):
(WebKit::RemoteLayerTreeEventDispatcher::handleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::wheelEventWasHandledByScrollingThread):
(WebKit::RemoteLayerTreeEventDispatcher::internalHandleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::mainThreadDisplayDidRefresh):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm:
(WebKit::RemoteScrollingCoordinatorProxyMac::RemoteScrollingCoordinatorProxyMac):
(WebKit::RemoteScrollingCoordinatorProxyMac::handleWheelEvent):
(WebKit::RemoteScrollingCoordinatorProxyMac::hasNodeWithAnimatedScrollChanged):
(WebKit::RemoteScrollingCoordinatorProxyMac::displayDidRefresh):
(WebKit::RemoteScrollingCoordinatorProxyMac::filteredWheelEvent): Deleted.
(WebKit::RemoteScrollingCoordinatorProxyMac::didReceiveWheelEvent): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm:
(WebKit::RemoteScrollingTreeMac::displayDidRefresh):
(WebKit::RemoteScrollingTreeMac::handleMouseEvent):
(WebKit::RemoteScrollingTreeMac::didCommitTree):
(WebKit::RemoteScrollingTreeMac::startPendingScrollAnimations):
(WebKit::RemoteScrollingTreeMac::hasNodeWithAnimatedScrollChanged):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidScroll):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeDidStopAnimatedScroll):
(WebKit::RemoteScrollingTreeMac::scrollingTreeNodeRequestsScroll):
(WebKit::RemoteScrollingTreeMac::currentSnapPointIndicesDidChange):
(WebKit::RemoteScrollingTreeMac::reportExposedUnfilledArea):
(WebKit::RemoteScrollingTreeMac::reportSynchronousScrollingReasonsChanged):
(WebKit::RemoteScrollingTreeMac::receivedWheelEventWithPhases):
(WebKit::RemoteScrollingTreeMac::deferWheelEventTestCompletionForReason):
(WebKit::RemoteScrollingTreeMac::removeWheelEventTestCompletionDeferralForReason):

Canonical link: https://commits.webkit.org/260917@main




More information about the webkit-changes mailing list