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 23 matching lines...) Expand all Loading... |
34 #include "core/inspector/InspectorLayerTreeAgent.h" | 34 #include "core/inspector/InspectorLayerTreeAgent.h" |
35 | 35 |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/frame/LocalFrame.h" | 37 #include "core/frame/LocalFrame.h" |
38 #include "core/inspector/IdentifiersFactory.h" | 38 #include "core/inspector/IdentifiersFactory.h" |
39 #include "core/inspector/InspectorNodeIds.h" | 39 #include "core/inspector/InspectorNodeIds.h" |
40 #include "core/inspector/InspectorState.h" | 40 #include "core/inspector/InspectorState.h" |
41 #include "core/inspector/InstrumentingAgents.h" | 41 #include "core/inspector/InstrumentingAgents.h" |
42 #include "core/loader/DocumentLoader.h" | 42 #include "core/loader/DocumentLoader.h" |
43 #include "core/page/Page.h" | 43 #include "core/page/Page.h" |
| 44 #include "core/rendering/RenderPart.h" |
44 #include "core/rendering/RenderView.h" | 45 #include "core/rendering/RenderView.h" |
45 #include "core/rendering/RenderWidget.h" | |
46 #include "core/rendering/compositing/CompositedLayerMapping.h" | 46 #include "core/rendering/compositing/CompositedLayerMapping.h" |
47 #include "core/rendering/compositing/RenderLayerCompositor.h" | 47 #include "core/rendering/compositing/RenderLayerCompositor.h" |
48 #include "platform/geometry/IntRect.h" | 48 #include "platform/geometry/IntRect.h" |
49 #include "platform/graphics/CompositingReasons.h" | 49 #include "platform/graphics/CompositingReasons.h" |
50 #include "platform/graphics/GraphicsContextRecorder.h" | 50 #include "platform/graphics/GraphicsContextRecorder.h" |
51 #include "platform/image-encoders/skia/PNGImageEncoder.h" | 51 #include "platform/image-encoders/skia/PNGImageEncoder.h" |
52 #include "platform/transforms/TransformationMatrix.h" | 52 #include "platform/transforms/TransformationMatrix.h" |
53 #include "public/platform/WebFloatPoint.h" | 53 #include "public/platform/WebFloatPoint.h" |
54 #include "public/platform/WebLayer.h" | 54 #include "public/platform/WebLayer.h" |
55 #include "wtf/text/Base64.h" | 55 #include "wtf/text/Base64.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 if (root->hasCompositedLayerMapping()) { | 230 if (root->hasCompositedLayerMapping()) { |
231 if (Node* node = root->renderer()->generatingNode()) { | 231 if (Node* node = root->renderer()->generatingNode()) { |
232 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child
ForSuperlayers(); | 232 GraphicsLayer* graphicsLayer = root->compositedLayerMapping()->child
ForSuperlayers(); |
233 layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNo
de(node)); | 233 layerIdToNodeIdMap.set(graphicsLayer->platformLayer()->id(), idForNo
de(node)); |
234 } | 234 } |
235 } | 235 } |
236 for (RenderLayer* child = root->firstChild(); child; child = child->nextSibl
ing()) | 236 for (RenderLayer* child = root->firstChild(); child; child = child->nextSibl
ing()) |
237 buildLayerIdToNodeIdMap(child, layerIdToNodeIdMap); | 237 buildLayerIdToNodeIdMap(child, layerIdToNodeIdMap); |
238 if (!root->renderer()->isRenderIFrame()) | 238 if (!root->renderer()->isRenderIFrame()) |
239 return; | 239 return; |
240 FrameView* childFrameView = toFrameView(toRenderWidget(root->renderer())->wi
dget()); | 240 FrameView* childFrameView = toFrameView(toRenderPart(root->renderer())->widg
et()); |
241 if (RenderView* childRenderView = childFrameView->renderView()) { | 241 if (RenderView* childRenderView = childFrameView->renderView()) { |
242 if (RenderLayerCompositor* childCompositor = childRenderView->compositor
()) | 242 if (RenderLayerCompositor* childCompositor = childRenderView->compositor
()) |
243 buildLayerIdToNodeIdMap(childCompositor->rootRenderLayer(), layerIdT
oNodeIdMap); | 243 buildLayerIdToNodeIdMap(childCompositor->rootRenderLayer(), layerIdT
oNodeIdMap); |
244 } | 244 } |
245 } | 245 } |
246 | 246 |
247 void InspectorLayerTreeAgent::gatherGraphicsLayers(GraphicsLayer* root, HashMap<
int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree:
:Layer> >& layers) | 247 void InspectorLayerTreeAgent::gatherGraphicsLayers(GraphicsLayer* root, HashMap<
int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree:
:Layer> >& layers) |
248 { | 248 { |
249 int layerId = root->platformLayer()->id(); | 249 int layerId = root->platformLayer()->id(); |
250 if (m_pageOverlayLayerIds.find(layerId) != WTF::kNotFound) | 250 if (m_pageOverlayLayerIds.find(layerId) != WTF::kNotFound) |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) | 423 void InspectorLayerTreeAgent::didRemovePageOverlay(const GraphicsLayer* layer) |
424 { | 424 { |
425 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); | 425 size_t index = m_pageOverlayLayerIds.find(layer->platformLayer()->id()); |
426 if (index == WTF::kNotFound) | 426 if (index == WTF::kNotFound) |
427 return; | 427 return; |
428 m_pageOverlayLayerIds.remove(index); | 428 m_pageOverlayLayerIds.remove(index); |
429 } | 429 } |
430 | 430 |
431 | 431 |
432 } // namespace blink | 432 } // namespace blink |
OLD | NEW |