Give all PlatformCALayers a PlatformLayerID, not just remote ones
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jan 2014 00:15:12 +0000 (00:15 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 Jan 2014 00:15:12 +0000 (00:15 +0000)
commit6e8772de343fd994b1e4772a933a9e0e02f44de7
treeb485906edcdb8d54149385f8bff9dc989fa81527
parent22af709c3f2f45dd3d1803574f527197de2834f9
Give all PlatformCALayers a PlatformLayerID, not just remote ones
https://bugs.webkit.org/show_bug.cgi?id=126466

Reviewed by Tim Horton.

Source/WebCore:

The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
which is confusing, and is necessary because the underlying PlatformLayer
inside a GraphicsLayer can change. In order to hide some of this complexity,
expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
can hold onto to test for underlying layer swapping.

Also constify LayerType m_layerType on PlatformCALayer, which required
cleaning up the construction of PlatformCALayerMac in the case where a
PlatformCALayerMac is wrapping an existing CALayer (which happens for video).

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::primaryLayerID):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::primaryLayerID):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::generateLayerID):
(WebCore::PlatformCALayer::PlatformCALayer):
* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::layerID):
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::create):
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::commonInit):

Source/WebKit2:

The ScrollingStateTree has references to both GraphicsLayers and PlatformLayers
which is confusing, and is necessary because the underlying PlatformLayer
inside a GraphicsLayer can change. In order to hide some of this complexity,
expose GraphicsLayer::primaryLayerID() which is a PlatformLayerID that clients
can hold onto to test for underlying layer swapping.

GraphicsLayerCARemote and PlatformCALayerRemote can now just use the
primaryLayerID() function exposed via the base class.

* WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::PlatformCALayerRemote):
(PlatformCALayerRemote::recursiveBuildTransaction):
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161293 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/platform/graphics/ca/PlatformCALayer.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h