Index: Source/core/inspector/InspectorLayerTreeAgent.cpp |
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp |
index b7b1f46ea5b05936aaf2c57e2f0ee1a3b60b511d..a52a0226230698847aaa86b1d1144cb25bd1bae0 100644 |
--- a/Source/core/inspector/InspectorLayerTreeAgent.cpp |
+++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp |
@@ -110,16 +110,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) |
@@ -212,6 +202,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); |
@@ -384,4 +386,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 |