| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 | 63 |
| 64 // Called from InspectorController | 64 // Called from InspectorController |
| 65 void willAddPageOverlay(const GraphicsLayer*); | 65 void willAddPageOverlay(const GraphicsLayer*); |
| 66 void didRemovePageOverlay(const GraphicsLayer*); | 66 void didRemovePageOverlay(const GraphicsLayer*); |
| 67 | 67 |
| 68 // Called from InspectorInstrumentation | 68 // Called from InspectorInstrumentation |
| 69 void layerTreeDidChange(); | 69 void layerTreeDidChange(); |
| 70 void didPaint(const GraphicsLayer*, GraphicsContext&, const LayoutRect&); | 70 void didPaint(const GraphicsLayer*, GraphicsContext&, const LayoutRect&); |
| 71 | 71 |
| 72 // Called from the front-end. | 72 // Called from the front-end. |
| 73 void enable(ErrorString*) override; | 73 Response enable() override; |
| 74 void disable(ErrorString*) override; | 74 Response disable() override; |
| 75 void compositingReasons( | 75 Response compositingReasons( |
| 76 ErrorString*, | |
| 77 const String& layerId, | 76 const String& layerId, |
| 78 std::unique_ptr<protocol::Array<String>>* compositingReasons) override; | 77 std::unique_ptr<protocol::Array<String>>* compositingReasons) override; |
| 79 void makeSnapshot(ErrorString*, | 78 Response makeSnapshot(const String& layerId, String* snapshotId) override; |
| 80 const String& layerId, | 79 Response loadSnapshot( |
| 81 String* snapshotId) override; | |
| 82 void loadSnapshot( | |
| 83 ErrorString*, | |
| 84 std::unique_ptr<protocol::Array<protocol::LayerTree::PictureTile>> tiles, | 80 std::unique_ptr<protocol::Array<protocol::LayerTree::PictureTile>> tiles, |
| 85 String* snapshotId) override; | 81 String* snapshotId) override; |
| 86 void releaseSnapshot(ErrorString*, const String& snapshotId) override; | 82 Response releaseSnapshot(const String& snapshotId) override; |
| 87 void profileSnapshot( | 83 Response profileSnapshot( |
| 88 ErrorString*, | |
| 89 const String& snapshotId, | 84 const String& snapshotId, |
| 90 const Maybe<int>& minRepeatCount, | 85 Maybe<int> minRepeatCount, |
| 91 const Maybe<double>& minDuration, | 86 Maybe<double> minDuration, |
| 92 const Maybe<protocol::DOM::Rect>& clipRect, | 87 Maybe<protocol::DOM::Rect> clipRect, |
| 93 std::unique_ptr<protocol::Array<protocol::Array<double>>>* timings) | 88 std::unique_ptr<protocol::Array<protocol::Array<double>>>* timings) |
| 94 override; | 89 override; |
| 95 void replaySnapshot(ErrorString*, | 90 Response replaySnapshot(const String& snapshotId, |
| 96 const String& snapshotId, | 91 Maybe<int> fromStep, |
| 97 const Maybe<int>& fromStep, | 92 Maybe<int> toStep, |
| 98 const Maybe<int>& toStep, | 93 Maybe<double> scale, |
| 99 const Maybe<double>& scale, | 94 String* dataURL) override; |
| 100 String* dataURL) override; | 95 Response snapshotCommandLog( |
| 101 void snapshotCommandLog( | |
| 102 ErrorString*, | |
| 103 const String& snapshotId, | 96 const String& snapshotId, |
| 104 std::unique_ptr<protocol::Array<protocol::DictionaryValue>>* commandLog) | 97 std::unique_ptr<protocol::Array<protocol::DictionaryValue>>* commandLog) |
| 105 override; | 98 override; |
| 106 | 99 |
| 107 // Called by other agents. | 100 // Called by other agents. |
| 108 std::unique_ptr<protocol::Array<protocol::LayerTree::Layer>> buildLayerTree(); | 101 std::unique_ptr<protocol::Array<protocol::LayerTree::Layer>> buildLayerTree(); |
| 109 | 102 |
| 110 private: | 103 private: |
| 111 static unsigned s_lastSnapshotId; | 104 static unsigned s_lastSnapshotId; |
| 112 | 105 |
| 113 explicit InspectorLayerTreeAgent(InspectedFrames*); | 106 explicit InspectorLayerTreeAgent(InspectedFrames*); |
| 114 | 107 |
| 115 GraphicsLayer* rootGraphicsLayer(); | 108 GraphicsLayer* rootGraphicsLayer(); |
| 116 | 109 |
| 117 PaintLayerCompositor* paintLayerCompositor(); | 110 PaintLayerCompositor* paintLayerCompositor(); |
| 118 GraphicsLayer* layerById(ErrorString*, const String& layerId); | 111 Response layerById(const String& layerId, GraphicsLayer*&); |
| 119 const PictureSnapshot* snapshotById(ErrorString*, const String& snapshotId); | 112 Response snapshotById(const String& snapshotId, const PictureSnapshot*&); |
| 120 | 113 |
| 121 typedef HashMap<int, int> LayerIdToNodeIdMap; | 114 typedef HashMap<int, int> LayerIdToNodeIdMap; |
| 122 void buildLayerIdToNodeIdMap(PaintLayer*, LayerIdToNodeIdMap&); | 115 void buildLayerIdToNodeIdMap(PaintLayer*, LayerIdToNodeIdMap&); |
| 123 void gatherGraphicsLayers( | 116 void gatherGraphicsLayers( |
| 124 GraphicsLayer*, | 117 GraphicsLayer*, |
| 125 HashMap<int, int>& layerIdToNodeIdMap, | 118 HashMap<int, int>& layerIdToNodeIdMap, |
| 126 std::unique_ptr<protocol::Array<protocol::LayerTree::Layer>>&, | 119 std::unique_ptr<protocol::Array<protocol::LayerTree::Layer>>&, |
| 127 bool hasWheelEventHandlers, | 120 bool hasWheelEventHandlers, |
| 128 int scrollingRootLayerId); | 121 int scrollingRootLayerId); |
| 129 int idForNode(Node*); | 122 int idForNode(Node*); |
| 130 | 123 |
| 131 Member<InspectedFrames> m_inspectedFrames; | 124 Member<InspectedFrames> m_inspectedFrames; |
| 132 Vector<int, 2> m_pageOverlayLayerIds; | 125 Vector<int, 2> m_pageOverlayLayerIds; |
| 133 | 126 |
| 134 typedef HashMap<String, RefPtr<PictureSnapshot>> SnapshotById; | 127 typedef HashMap<String, RefPtr<PictureSnapshot>> SnapshotById; |
| 135 SnapshotById m_snapshotById; | 128 SnapshotById m_snapshotById; |
| 136 bool m_suppressLayerPaintEvents; | 129 bool m_suppressLayerPaintEvents; |
| 137 }; | 130 }; |
| 138 | 131 |
| 139 } // namespace blink | 132 } // namespace blink |
| 140 | 133 |
| 141 #endif // !defined(InspectorLayerTreeAgent_h) | 134 #endif // !defined(InspectorLayerTreeAgent_h) |
| OLD | NEW |