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 26 matching lines...) Expand all Loading... |
37 #include "core/rendering/RenderLayer.h" | 37 #include "core/rendering/RenderLayer.h" |
38 #include "wtf/PassOwnPtr.h" | 38 #include "wtf/PassOwnPtr.h" |
39 #include "wtf/PassRefPtr.h" | 39 #include "wtf/PassRefPtr.h" |
40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
41 | 41 |
42 namespace WebCore { | 42 namespace WebCore { |
43 | 43 |
44 class InspectorDOMAgent; | 44 class InspectorDOMAgent; |
45 class InstrumentingAgents; | 45 class InstrumentingAgents; |
46 class Page; | 46 class Page; |
| 47 class RenderLayerCompositor; |
47 | 48 |
48 typedef String ErrorString; | 49 typedef String ErrorString; |
49 | 50 |
50 class InspectorLayerTreeAgent : public InspectorBaseAgent<InspectorLayerTreeAgen
t>, public InspectorBackendDispatcher::LayerTreeCommandHandler { | 51 class InspectorLayerTreeAgent : public InspectorBaseAgent<InspectorLayerTreeAgen
t>, public InspectorBackendDispatcher::LayerTreeCommandHandler { |
51 public: | 52 public: |
52 static PassOwnPtr<InspectorLayerTreeAgent> create(InstrumentingAgents* instr
umentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, Pag
e* page) | 53 static PassOwnPtr<InspectorLayerTreeAgent> create(InstrumentingAgents* instr
umentingAgents, InspectorCompositeState* state, InspectorDOMAgent* domAgent, Pag
e* page) |
53 { | 54 { |
54 return adoptPtr(new InspectorLayerTreeAgent(instrumentingAgents, state,
domAgent, page)); | 55 return adoptPtr(new InspectorLayerTreeAgent(instrumentingAgents, state,
domAgent, page)); |
55 } | 56 } |
56 ~InspectorLayerTreeAgent(); | 57 ~InspectorLayerTreeAgent(); |
57 | 58 |
58 virtual void setFrontend(InspectorFrontend*); | 59 virtual void setFrontend(InspectorFrontend*); |
59 virtual void clearFrontend(); | 60 virtual void clearFrontend(); |
60 virtual void restore(); | 61 virtual void restore(); |
61 | 62 |
62 void didCommitLoad(Frame*, DocumentLoader*); | 63 void didCommitLoad(Frame*, DocumentLoader*); |
63 void layerTreeDidChange(); | 64 void layerTreeDidChange(); |
64 | 65 |
65 // Called from the front-end. | 66 // Called from the front-end. |
66 virtual void enable(ErrorString*); | 67 virtual void enable(ErrorString*); |
67 virtual void disable(ErrorString*); | 68 virtual void disable(ErrorString*); |
68 virtual void getLayers(ErrorString*, const int* nodeId, RefPtr<TypeBuilder::
Array<TypeBuilder::LayerTree::Layer> >&); | 69 virtual void getLayers(ErrorString*, const int* nodeId, RefPtr<TypeBuilder::
Array<TypeBuilder::LayerTree::Layer> >&); |
| 70 virtual void compositingReasons(ErrorString*, const String& layerId, RefPtr<
TypeBuilder::Array<String> >&); |
69 | 71 |
70 private: | 72 private: |
71 InspectorLayerTreeAgent(InstrumentingAgents*, InspectorCompositeState*, Insp
ectorDOMAgent*, Page*); | 73 InspectorLayerTreeAgent(InstrumentingAgents*, InspectorCompositeState*, Insp
ectorDOMAgent*, Page*); |
72 | 74 |
| 75 RenderLayerCompositor* renderLayerCompositor(ErrorString*); |
| 76 GraphicsLayer* layerById(ErrorString*, const String& layerId); |
| 77 int idForNode(ErrorString*, Node*); |
| 78 |
73 void gatherLayersUsingRenderObjectHierarchy(ErrorString*, RenderObject*, Ref
Ptr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); | 79 void gatherLayersUsingRenderObjectHierarchy(ErrorString*, RenderObject*, Ref
Ptr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
74 void gatherLayersUsingRenderLayerHierarchy(ErrorString*, RenderLayer*, RefPt
r<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); | 80 void gatherLayersUsingRenderLayerHierarchy(ErrorString*, RenderLayer*, RefPt
r<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
75 void gatherLayersUsingGraphicsLayerHierarchy(ErrorString*, GraphicsLayer*, R
efPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); | 81 void gatherLayersUsingGraphicsLayerHierarchy(ErrorString*, GraphicsLayer*, R
efPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
76 void addRenderLayerBacking(ErrorString*, RenderLayerBacking*, Node*, RefPtr<
TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); | 82 void addRenderLayerBacking(ErrorString*, RenderLayerBacking*, Node*, RefPtr<
TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&); |
77 | 83 |
78 int idForNode(ErrorString*, Node*); | |
79 | |
80 InspectorFrontend::LayerTree* m_frontend; | 84 InspectorFrontend::LayerTree* m_frontend; |
81 Page* m_page; | 85 Page* m_page; |
82 InspectorDOMAgent* m_domAgent; | 86 InspectorDOMAgent* m_domAgent; |
83 | 87 |
84 HashMap<const RenderLayer*, String> m_documentLayerToIdMap; | 88 HashMap<const RenderLayer*, String> m_documentLayerToIdMap; |
85 }; | 89 }; |
86 | 90 |
87 } // namespace WebCore | 91 } // namespace WebCore |
88 | 92 |
89 | 93 |
90 #endif // !defined(InspectorLayerTreeAgent_h) | 94 #endif // !defined(InspectorLayerTreeAgent_h) |
OLD | NEW |