Implement asynchronous frame scrolling for iOS
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 20:07:44 +0000 (20:07 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 Jan 2019 20:07:44 +0000 (20:07 +0000)
commitd3f69fe3583b188cf0b79123f62a88f027a013f7
treec6b1e9420d4b15dbe19afe29b124f399b83ff53d
parentd79d95ed19af621896dd89cbdd416c69446701f1
Implement asynchronous frame scrolling for iOS
https://bugs.webkit.org/show_bug.cgi?id=193539
<rdar://problem/47379873>

Reviewed by Simon Fraser.

Source/WebCore:

This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
internal setting (still off by default).

* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):

Export ScrollingTreeFrameScrollingNodeIOS.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerClipping):

If we don't have a separate clip layer, just resize and position the scroll layer.

(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):

Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
Don't create a separate clip layer since the scroll layer will handle clipping.

* rendering/RenderLayerCompositor.h:

Source/WebKit:

Add a scrolling node type that can handle UIScrollView backed frames.
It basically just instantiates and forwards to the existing ScrollingTreeScrollingNodeDelegateIOS.

* UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp:
(WebKit::RemoteScrollingTree::createScrollingTreeNode):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h: Added.
* UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm: Added.
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::create):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::~ScrollingTreeFrameScrollingNodeRemoteIOS):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateBeforeChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::commitStateAfterChildren):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterAncestorChange):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::scrollPosition const):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::setScrollLayerPosition):
(WebKit::ScrollingTreeFrameScrollingNodeRemoteIOS::updateLayersAfterDelegatedScroll):
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

* platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240162 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/ios-wk2/compositing/tiling/tiled-drawing-async-frame-scrolling-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h
Source/WebCore/page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/ChangeLog
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingTree.cpp
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.h [new file with mode: 0644]
Source/WebKit/UIProcess/RemoteLayerTree/ios/ScrollingTreeFrameScrollingNodeRemoteIOS.mm [new file with mode: 0644]
Source/WebKit/WebKit.xcodeproj/project.pbxproj