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 | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. 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 16 matching lines...) Expand all Loading... |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef InspectorLayerTreeAgent_h | 30 #ifndef InspectorLayerTreeAgent_h |
31 #define InspectorLayerTreeAgent_h | 31 #define InspectorLayerTreeAgent_h |
32 | 32 |
33 | 33 |
34 #include "core/InspectorFrontend.h" | 34 #include "core/InspectorFrontend.h" |
35 #include "core/InspectorTypeBuilder.h" | 35 #include "core/InspectorTypeBuilder.h" |
36 #include "core/inspector/InspectorBaseAgent.h" | 36 #include "core/inspector/InspectorBaseAgent.h" |
37 #include "core/rendering/RenderLayer.h" | 37 #include "core/layout/Layer.h" |
38 #include "platform/Timer.h" | 38 #include "platform/Timer.h" |
39 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" |
40 #include "wtf/PassRefPtr.h" | 40 #include "wtf/PassRefPtr.h" |
41 #include "wtf/text/WTFString.h" | 41 #include "wtf/text/WTFString.h" |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class InspectorPageAgent; | 45 class InspectorPageAgent; |
46 class PictureSnapshot; | 46 class PictureSnapshot; |
47 class RenderLayerCompositor; | 47 class LayerCompositor; |
48 | 48 |
49 typedef String ErrorString; | 49 typedef String ErrorString; |
50 | 50 |
51 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr
eeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler { | 51 class InspectorLayerTreeAgent final : public InspectorBaseAgent<InspectorLayerTr
eeAgent>, public InspectorBackendDispatcher::LayerTreeCommandHandler { |
52 public: | 52 public: |
53 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA
gent* pageAgent) | 53 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA
gent* pageAgent) |
54 { | 54 { |
55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent)); | 55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent)); |
56 } | 56 } |
57 virtual ~InspectorLayerTreeAgent(); | 57 virtual ~InspectorLayerTreeAgent(); |
(...skipping 25 matching lines...) Expand all Loading... |
83 // Called by other agents. | 83 // Called by other agents. |
84 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre
e(); | 84 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre
e(); |
85 | 85 |
86 private: | 86 private: |
87 static unsigned s_lastSnapshotId; | 87 static unsigned s_lastSnapshotId; |
88 | 88 |
89 explicit InspectorLayerTreeAgent(InspectorPageAgent*); | 89 explicit InspectorLayerTreeAgent(InspectorPageAgent*); |
90 | 90 |
91 GraphicsLayer* rootGraphicsLayer(); | 91 GraphicsLayer* rootGraphicsLayer(); |
92 | 92 |
93 RenderLayerCompositor* renderLayerCompositor(); | 93 LayerCompositor* renderLayerCompositor(); |
94 GraphicsLayer* layerById(ErrorString*, const String& layerId); | 94 GraphicsLayer* layerById(ErrorString*, const String& layerId); |
95 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); | 95 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); |
96 | 96 |
97 typedef HashMap<int, int> LayerIdToNodeIdMap; | 97 typedef HashMap<int, int> LayerIdToNodeIdMap; |
98 void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&); | 98 void buildLayerIdToNodeIdMap(Layer*, LayerIdToNodeIdMap&); |
99 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId
Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); | 99 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId
Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
100 int idForNode(Node*); | 100 int idForNode(Node*); |
101 | 101 |
102 InspectorFrontend::LayerTree* m_frontend; | 102 InspectorFrontend::LayerTree* m_frontend; |
103 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; | 103 RawPtrWillBeMember<InspectorPageAgent> m_pageAgent; |
104 Vector<int, 2> m_pageOverlayLayerIds; | 104 Vector<int, 2> m_pageOverlayLayerIds; |
105 | 105 |
106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById; | 106 typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById; |
107 SnapshotById m_snapshotById; | 107 SnapshotById m_snapshotById; |
108 }; | 108 }; |
109 | 109 |
110 } // namespace blink | 110 } // namespace blink |
111 | 111 |
112 | 112 |
113 #endif // !defined(InspectorLayerTreeAgent_h) | 113 #endif // !defined(InspectorLayerTreeAgent_h) |
OLD | NEW |