| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 LayerIdToNodeIdMap layerIdToNodeIdMap; | 225 LayerIdToNodeIdMap layerIdToNodeIdMap; |
| 226 RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > layers = TypeBuil
der::Array<TypeBuilder::LayerTree::Layer>::create(); | 226 RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > layers = TypeBuil
der::Array<TypeBuilder::LayerTree::Layer>::create(); |
| 227 buildLayerIdToNodeIdMap(compositor->rootLayer(), layerIdToNodeIdMap); | 227 buildLayerIdToNodeIdMap(compositor->rootLayer(), layerIdToNodeIdMap); |
| 228 gatherGraphicsLayers(rootGraphicsLayer(), layerIdToNodeIdMap, layers); | 228 gatherGraphicsLayers(rootGraphicsLayer(), layerIdToNodeIdMap, layers); |
| 229 return layers.release(); | 229 return layers.release(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(Layer* root, LayerIdToNode
IdMap& layerIdToNodeIdMap) | 232 void InspectorLayerTreeAgent::buildLayerIdToNodeIdMap(Layer* root, LayerIdToNode
IdMap& layerIdToNodeIdMap) |
| 233 { | 233 { |
| 234 if (root->hasCompositedLayerMapping()) { | 234 if (root->hasCompositedLayerMapping()) { |
| 235 if (Node* node = root->renderer()->generatingNode()) { | 235 if (Node* node = root->layoutObject()->generatingNode()) { |
| 236 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child
ForSuperlayers(); | 236 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child
ForSuperlayers(); |
| 237 layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNo
de(node)); | 237 layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNo
de(node)); |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 for (Layer* child = root->firstChild(); child; child = child->nextSibling()) | 240 for (Layer* child = root->firstChild(); child; child = child->nextSibling()) |
| 241 buildLayerIdToNodeIdMap(child, layerIdToNodeIdMap); | 241 buildLayerIdToNodeIdMap(child, layerIdToNodeIdMap); |
| 242 if (!root->renderer()->isLayoutIFrame()) | 242 if (!root->layoutObject()->isLayoutIFrame()) |
| 243 return; | 243 return; |
| 244 FrameView* childFrameView = toFrameView(toLayoutPart(root->renderer())->widg
et()); | 244 FrameView* childFrameView = toFrameView(toLayoutPart(root->layoutObject())->
widget()); |
| 245 if (LayoutView* childLayoutView = childFrameView->layoutView()) { | 245 if (LayoutView* childLayoutView = childFrameView->layoutView()) { |
| 246 if (LayerCompositor* childCompositor = childLayoutView->compositor()) | 246 if (LayerCompositor* childCompositor = childLayoutView->compositor()) |
| 247 buildLayerIdToNodeIdMap(childCompositor->rootLayer(), layerIdToNodeI
dMap); | 247 buildLayerIdToNodeIdMap(childCompositor->rootLayer(), layerIdToNodeI
dMap); |
| 248 } | 248 } |
| 249 } | 249 } |
| 250 | 250 |
| 251 void InspectorLayerTreeAgent::gatherGraphicsLayers(GraphicsLayer* root, HashMap<
int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree:
:Layer> >& layers) | 251 void InspectorLayerTreeAgent::gatherGraphicsLayers(GraphicsLayer* root, HashMap<
int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree:
:Layer> >& layers) |
| 252 { | 252 { |
| 253 int layerId = root->platformLayer()->id(); | 253 int layerId = root->platformLayer()->id(); |
| 254 if (m_pageOverlayLayerIds.find(layerId) != WTF::kNotFound) | 254 if (m_pageOverlayLayerIds.find(layerId) != WTF::kNotFound) |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) | 487 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) |
| 488 { | 488 { |
| 489 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); | 489 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); |
| 490 if (index == WTF::kNotFound) | 490 if (index == WTF::kNotFound) |
| 491 return; | 491 return; |
| 492 m_pageOverlayLayerIds.remove(index); | 492 m_pageOverlayLayerIds.remove(index); |
| 493 } | 493 } |
| 494 | 494 |
| 495 | 495 |
| 496 } // namespace blink | 496 } // namespace blink |
| OLD | NEW |