[webkit-changes] [WebKit/WebKit] 41dd55: Introduce RemoteLayerTreeEventDispatcher for threa...

Simon Fraser noreply at github.com
Wed Feb 22 11:45:40 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 41dd555e7e49b0765636e06be569d29ce1355d4d
      https://github.com/WebKit/WebKit/commit/41dd555e7e49b0765636e06be569d29ce1355d4d
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-02-22 (Wed, 22 Feb 2023)

  Changed paths:
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h
    M Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm
    A Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp
    A 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/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  Introduce RemoteLayerTreeEventDispatcher for threaded UI-side scrolling
https://bugs.webkit.org/show_bug.cgi?id=252724
rdar://105763050

Reviewed by Tim Horton.

Introduce RemoteLayerTreeEventDispatcher for threaded scrolling in the UI Process. This
class needs to be thread safe both for interactions with the scrolling thread, and for
`displayDidRefresh` notifications coming from a display link. RemoteScrollingCoordinatorProxy
isn't refcounted, so it's cleaner to have a new thread safe refcounted class for these
between-thread interactions. RemoteScrollingCoordinatorProxy code will only run on the
main-thread.

RemoteLayerTreeEventDispatcher is roughly analogous to WebPage/EventDispatcher.

The responsibilities of RemoteLayerTreeEventDispatcher will be as follow:
1. Dispatch wheel events and `displayDidRefresh` to the scrolling tree.
2. Dispatch messages from the scrolling tree back to RemoteScrollingCoordinatorProxy on the main thread.
3. Use a DisplayLink::Client to bounce `displayDidRefresh` from the CVDisplayLink thread
   to the scrolling thread.
4. Own the WheelEventDeltaFilter
5. Own a MomentumEventGenerator
6. Start and stop high-frequency display link callbacks for scroll animations and momentum

This functionality will be fleshed out in future PRs.

* Source/WebKit/SourcesCocoa.txt:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
(WebKit::RemoteLayerTreeDrawingAreaProxy::isRemoteLayerTreeDrawingAreaProxyMac const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h:
(WebKit::RemoteScrollingCoordinatorProxy::windowScreenDidChange):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::displayLink):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::scheduleDisplayRefreshCallbacks):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::setDisplayLinkWantsFullSpeedUpdates):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::windowScreenDidChange):
(WebKit::RemoteLayerTreeDrawingAreaProxyMac::ensureDisplayLink): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.cpp: Added.
(WebKit::RemoteLayerTreeEventDispatcher::create):
(WebKit::RemoteLayerTreeEventDispatcher::RemoteLayerTreeEventDispatcher):
(WebKit::m_wheelEventDeltaFilter):
(WebKit::RemoteLayerTreeEventDispatcher::invalidate):
(WebKit::RemoteLayerTreeEventDispatcher::setScrollingTree):
(WebKit::RemoteLayerTreeEventDispatcher::scrollingTree):
(WebKit::RemoteLayerTreeEventDispatcher::willHandleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::handleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::internalHandleWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::filteredWheelEvent):
(WebKit::RemoteLayerTreeEventDispatcher::didRefreshDisplay):
(WebKit::RemoteLayerTreeEventDispatcher::windowScreenDidChange):
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeEventDispatcher.h: Added.
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.h:
* Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingCoordinatorProxyMac.mm:
(WebKit::RemoteScrollingCoordinatorProxyMac::RemoteScrollingCoordinatorProxyMac):
(WebKit::RemoteScrollingCoordinatorProxyMac::~RemoteScrollingCoordinatorProxyMac):
(WebKit::RemoteScrollingCoordinatorProxyMac::displayDidRefresh):
(WebKit::RemoteScrollingCoordinatorProxyMac::establishLayerTreeScrollingRelations):
(WebKit::RemoteScrollingCoordinatorProxyMac::windowScreenDidChange):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

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




More information about the webkit-changes mailing list