Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1303)

Unified Diff: Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 173763002: DevTools: hide page overlay layers in LayerTreeAgent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed stray watchdog from test Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.h ('k') | Source/web/PageOverlay.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « Source/core/inspector/InspectorLayerTreeAgent.h ('k') | Source/web/PageOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698