Replace LayerOrView typedef with a class
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Nov 2018 07:17:35 +0000 (07:17 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 24 Nov 2018 07:17:35 +0000 (07:17 +0000)
commit07e7fb918ea997b05c697840981b5af51419c5f2
tree8721666a10a58768421d8ef4ddf283d86edd2cad
parenta9efe0fb9dfc12c796cb2596131bc4856875ed8d
Replace LayerOrView typedef with a class
https://bugs.webkit.org/show_bug.cgi?id=191927

Reviewed by Tim Horton.

This typedef restricts remote layer representation to be either a CA layer or a view. We might want
have more flexibility, for example tiles don't really need to be UIViews. It will also make it easier
to unify Mac and iOS code, and hopefully make it less confusing too.

This patch introduces RemoteLayerTreeNode class that replaces most uses of LayerOrView typedef
(the rest are converted to pure CALayer). It also does a bunch of related cleanup.

* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h:
* Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::applyProperties):
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToUIView):
(WebKit::applyPropertiesToLayer): Deleted.
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _propertiesOfLayerWithID:]):
* UIProcess/Cocoa/LayerRepresentation.h: Removed.
* UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
(WebKit::VideoFullscreenManagerProxy::setupFullscreenWithID):
* UIProcess/PageClient.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
(WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
(WebKit::RemoteLayerTreeDrawingAreaProxy::layerWithIDForTesting const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
(WebKit::RemoteLayerTreeHost::rootNode const):
(WebKit::RemoteLayerTreeHost::rootLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::updateLayerTree):
(WebKit::RemoteLayerTreeHost::nodeForID const):
(WebKit::RemoteLayerTreeHost::layerWillBeRemoved):
(WebKit::RemoteLayerTreeHost::animationDidStart):
(WebKit::RemoteLayerTreeHost::animationDidEnd):
(WebKit::RemoteLayerTreeHost::clearLayers):
(WebKit::RemoteLayerTreeHost::layerWithIDForTesting const):
(WebKit::RemoteLayerTreeHost::layerForID const):
(WebKit::RemoteLayerTreeHost::rootLayer const):
(WebKit::RemoteLayerTreeHost::createLayer):
(WebKit::RemoteLayerTreeHost::detachRootLayer):
(WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
(WebKit::RemoteLayerTreeHost::getLayer const): Deleted.
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h: Added.
(WebKit::RemoteLayerTreeNode::layer const):
(WebKit::RemoteLayerTreeNode::uiView const):
* UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm: Added.
(WebKit::RemoteLayerTreeNode::RemoteLayerTreeNode):
(WebKit::RemoteLayerTreeNode::detachFromParent):
* UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm:
(WebKit::RemoteLayerTreeScrollingPerformanceData::blankPixelCount const):
* UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
* UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::connectStateNodeLayers):
(WebKit::layerRepresentationFromLayerOrView): Deleted.
* UIProcess/WebAuthentication/Cocoa/HidService.h:
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/LayerRepresentation.mm: Removed.
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::acceleratedCompositingRootLayer const):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/PageClientImplMac.h:
* UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::setRemoteLayerTreeRootNode):
(WebKit::PageClientImpl::setAcceleratedCompositingRootLayer): Deleted.
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::createFence):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setRemoteLayerTreeRootNode):
(WebKit::WebPageProxy::acceleratedCompositingRootLayer const):
(WebKit::WebPageProxy::setAcceleratedCompositingRootLayer): Deleted.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.h
Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
Source/WebKit/SourcesCocoa.txt
Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit/UIProcess/Cocoa/VideoFullscreenManagerProxy.mm
Source/WebKit/UIProcess/PageClient.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.h [moved from Source/WebKit/UIProcess/ios/LayerRepresentation.mm with 67% similarity]
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeNode.mm [moved from Source/WebKit/UIProcess/Cocoa/LayerRepresentation.h with 70% similarity]
Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeScrollingPerformanceData.mm
Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteLayerTreeHostIOS.mm
Source/WebKit/UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm
Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.h
Source/WebKit/UIProcess/WebAuthentication/Cocoa/HidService.mm
Source/WebKit/UIProcess/WebPageProxy.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit/UIProcess/mac/PageClientImplMac.h
Source/WebKit/UIProcess/mac/PageClientImplMac.mm
Source/WebKit/UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm
Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp