| 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 24 matching lines...) Expand all Loading... |
| 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/rendering/RenderLayer.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 PictureSnapshot; | 46 class PictureSnapshot; |
| 46 class Page; | |
| 47 class RenderLayerCompositor; | 47 class RenderLayerCompositor; |
| 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(Page* page) | 53 static PassOwnPtrWillBeRawPtr<InspectorLayerTreeAgent> create(InspectorPageA
gent* pageAgent) |
| 54 { | 54 { |
| 55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(page)); | 55 return adoptPtrWillBeNoop(new InspectorLayerTreeAgent(pageAgent)); |
| 56 } | 56 } |
| 57 virtual ~InspectorLayerTreeAgent(); | 57 virtual ~InspectorLayerTreeAgent(); |
| 58 virtual void trace(Visitor*) override; | 58 virtual void trace(Visitor*) override; |
| 59 | 59 |
| 60 virtual void setFrontend(InspectorFrontend*) override; | 60 virtual void setFrontend(InspectorFrontend*) override; |
| 61 virtual void clearFrontend() override; | 61 virtual void clearFrontend() override; |
| 62 virtual void restore() override; | 62 virtual void restore() override; |
| 63 | 63 |
| 64 // Called from InspectorController | 64 // Called from InspectorController |
| 65 void willAddPageOverlay(const GraphicsLayer*); | 65 void willAddPageOverlay(const GraphicsLayer*); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 79 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in
t* fromStep, const int* toStep, const double* scale, String* dataURL) override; | 79 virtual void replaySnapshot(ErrorString*, const String& snapshotId, const in
t* fromStep, const int* toStep, const double* scale, String* dataURL) override; |
| 80 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i
nt* minRepeatCount, const double* minDuration, const RefPtr<JSONObject>* clipRec
t, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&) override; | 80 virtual void profileSnapshot(ErrorString*, const String& snapshotId, const i
nt* minRepeatCount, const double* minDuration, const RefPtr<JSONObject>* clipRec
t, RefPtr<TypeBuilder::Array<TypeBuilder::Array<double> > >&) override; |
| 81 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP
tr<TypeBuilder::Array<JSONObject> >&) override; | 81 virtual void snapshotCommandLog(ErrorString*, const String& snapshotId, RefP
tr<TypeBuilder::Array<JSONObject> >&) override; |
| 82 | 82 |
| 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(Page*); | 89 explicit InspectorLayerTreeAgent(InspectorPageAgent*); |
| 90 | 90 |
| 91 GraphicsLayer* rootGraphicsLayer(); | 91 GraphicsLayer* rootGraphicsLayer(); |
| 92 | 92 |
| 93 RenderLayerCompositor* renderLayerCompositor(); | 93 RenderLayerCompositor* 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(RenderLayer*, 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<Page> m_page; | 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 |