| Index: Source/core/inspector/InspectorLayerTreeAgent.cpp
|
| diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp
|
| index 68fa440fb9acae0ab93c6d2f690eee4d2c0ce10d..a04fb6f1ba8e63cf3a6402a0422f7d160e6247ce 100644
|
| --- a/Source/core/inspector/InspectorLayerTreeAgent.cpp
|
| +++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp
|
| @@ -108,16 +108,6 @@ static PassRefPtr<TypeBuilder::LayerTree::Layer> buildObjectForLayer(GraphicsLay
|
| return layerObject;
|
| }
|
|
|
| -void gatherGraphicsLayers(GraphicsLayer* root, HashMap<int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >& layers)
|
| -{
|
| - int layerId = root->platformLayer()->id();
|
| - layers->addItem(buildObjectForLayer(root, layerIdToNodeIdMap.get(layerId)));
|
| - if (GraphicsLayer* replica = root->replicaLayer())
|
| - gatherGraphicsLayers(replica, layerIdToNodeIdMap, layers);
|
| - for (size_t i = 0, size = root->children().size(); i < size; ++i)
|
| - gatherGraphicsLayers(root->children()[i], layerIdToNodeIdMap, layers);
|
| -}
|
| -
|
| InspectorLayerTreeAgent::InspectorLayerTreeAgent(InspectorDOMAgent* domAgent, Page* page)
|
| : InspectorBaseAgent<InspectorLayerTreeAgent>("LayerTree")
|
| , m_frontend(0)
|
| @@ -210,6 +200,18 @@ void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(RenderLayer* root, LayerId
|
| }
|
| }
|
|
|
| +void InspectorLayerTreeAgent::gatherGraphicsLayers(GraphicsLayer* root, HashMap<int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >& layers)
|
| +{
|
| + int layerId = root->platformLayer()->id();
|
| + if (m_pageOverlayLayerIds.find(layerId) != WTF::kNotFound)
|
| + return;
|
| + layers->addItem(buildObjectForLayer(root, layerIdToNodeIdMap.get(layerId)));
|
| + if (GraphicsLayer* replica = root->replicaLayer())
|
| + gatherGraphicsLayers(replica, layerIdToNodeIdMap, layers);
|
| + for (size_t i = 0, size = root->children().size(); i < size; ++i)
|
| + gatherGraphicsLayers(root->children()[i], layerIdToNodeIdMap, layers);
|
| +}
|
| +
|
| int InspectorLayerTreeAgent::idForNode(Node* node)
|
| {
|
| int nodeId = m_domAgent->boundNodeId(node);
|
| @@ -382,4 +384,18 @@ void InspectorLayerTreeAgent::profileSnapshot(ErrorString* errorString, const St
|
| }
|
| }
|
|
|
| +void InspectorLayerTreeAgent::willAddPageOverlay(const GraphicsLayer* layer)
|
| +{
|
| + m_pageOverlayLayerIds.append(layer->platformLayer()->id());
|
| +}
|
| +
|
| +void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer)
|
| +{
|
| + size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id());
|
| + if (index == WTF::kNotFound)
|
| + return;
|
| + m_pageOverlayLayerIds.remove(index);
|
| +}
|
| +
|
| +
|
| } // namespace WebCore
|
|
|