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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 static PassOwnPtr<InspectorLayerTreeAgent> create(InspectorDOMAgent* domAgen
t, Page* page) | 56 static PassOwnPtr<InspectorLayerTreeAgent> create(InspectorDOMAgent* domAgen
t, Page* page) |
57 { | 57 { |
58 return adoptPtr(new InspectorLayerTreeAgent(domAgent, page)); | 58 return adoptPtr(new InspectorLayerTreeAgent(domAgent, page)); |
59 } | 59 } |
60 virtual ~InspectorLayerTreeAgent(); | 60 virtual ~InspectorLayerTreeAgent(); |
61 | 61 |
62 virtual void setFrontend(InspectorFrontend*) OVERRIDE; | 62 virtual void setFrontend(InspectorFrontend*) OVERRIDE; |
63 virtual void clearFrontend() OVERRIDE; | 63 virtual void clearFrontend() OVERRIDE; |
64 virtual void restore() OVERRIDE; | 64 virtual void restore() OVERRIDE; |
65 | 65 |
| 66 // Called from InspectorController |
| 67 void willAddPageOverlay(const GraphicsLayer*); |
| 68 void didRemovePageOverlay(const GraphicsLayer*); |
| 69 |
66 // Called from InspectorInstrumentation | 70 // Called from InspectorInstrumentation |
67 void layerTreeDidChange(); | 71 void layerTreeDidChange(); |
68 void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const L
ayoutRect&); | 72 void didPaint(RenderObject*, const GraphicsLayer*, GraphicsContext*, const L
ayoutRect&); |
69 | 73 |
70 // Called from the front-end. | 74 // Called from the front-end. |
71 virtual void enable(ErrorString*) OVERRIDE; | 75 virtual void enable(ErrorString*) OVERRIDE; |
72 virtual void disable(ErrorString*) OVERRIDE; | 76 virtual void disable(ErrorString*) OVERRIDE; |
73 virtual void compositingReasons(ErrorString*, const String& layerId, RefPtr<
TypeBuilder::Array<String> >&) OVERRIDE; | 77 virtual void compositingReasons(ErrorString*, const String& layerId, RefPtr<
TypeBuilder::Array<String> >&) OVERRIDE; |
74 virtual void makeSnapshot(ErrorString*, const String& layerId, String* snaps
hotId) OVERRIDE; | 78 virtual void makeSnapshot(ErrorString*, const String& layerId, String* snaps
hotId) OVERRIDE; |
75 virtual void releaseSnapshot(ErrorString*, const String& snapshotId) OVERRID
E; | 79 virtual void releaseSnapshot(ErrorString*, const String& snapshotId) OVERRID
E; |
76 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in
t* fromStep, const int* toStep, String* dataURL) OVERRIDE; | 80 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in
t* fromStep, const int* toStep, String* dataURL) OVERRIDE; |
77 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i
nt* minRepeatCount, const double* minDuration, RefPtr<TypeBuilder::Array<TypeBui
lder::Array<double> > >&) OVERRIDE; | 81 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i
nt* minRepeatCount, const double* minDuration, RefPtr<TypeBuilder::Array<TypeBui
lder::Array<double> > >&) OVERRIDE; |
78 | 82 |
79 private: | 83 private: |
80 static unsigned s_lastSnapshotId; | 84 static unsigned s_lastSnapshotId; |
81 | 85 |
82 InspectorLayerTreeAgent(InspectorDOMAgent*, Page*); | 86 InspectorLayerTreeAgent(InspectorDOMAgent*, Page*); |
83 | 87 |
84 RenderLayerCompositor* renderLayerCompositor(); | 88 RenderLayerCompositor* renderLayerCompositor(); |
85 GraphicsLayer* layerById(ErrorString*, const String& layerId); | 89 GraphicsLayer* layerById(ErrorString*, const String& layerId); |
86 const LayerSnapshot* snapshotById(ErrorString*, const String& snapshotId); | 90 const LayerSnapshot* snapshotById(ErrorString*, const String& snapshotId); |
87 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre
e(); | 91 PassRefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> > buildLayerTre
e(); |
88 | 92 |
89 typedef HashMap<int, int> LayerIdToNodeIdMap; | 93 typedef HashMap<int, int> LayerIdToNodeIdMap; |
90 void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&); | 94 void buildLayerIdToNodeIdMap(RenderLayer*, LayerIdToNodeIdMap&); |
| 95 void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeId
Map, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
91 int idForNode(Node*); | 96 int idForNode(Node*); |
92 | 97 |
93 InspectorFrontend::LayerTree* m_frontend; | 98 InspectorFrontend::LayerTree* m_frontend; |
94 Page* m_page; | 99 Page* m_page; |
95 InspectorDOMAgent* m_domAgent; | 100 InspectorDOMAgent* m_domAgent; |
| 101 Vector<int, 2> m_pageOverlayLayerIds; |
96 | 102 |
97 typedef HashMap<String, LayerSnapshot> SnapshotById; | 103 typedef HashMap<String, LayerSnapshot> SnapshotById; |
98 SnapshotById m_snapshotById; | 104 SnapshotById m_snapshotById; |
99 }; | 105 }; |
100 | 106 |
101 } // namespace WebCore | 107 } // namespace WebCore |
102 | 108 |
103 | 109 |
104 #endif // !defined(InspectorLayerTreeAgent_h) | 110 #endif // !defined(InspectorLayerTreeAgent_h) |
OLD | NEW |