OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** @typedef {!{ | 5 /** @typedef {!{ |
6 bounds: {height: number, width: number}, | 6 bounds: {height: number, width: number}, |
7 children: Array.<!WebInspector.TracingLayerPayload>, | 7 children: Array.<!WebInspector.TracingLayerPayload>, |
8 layer_id: number, | 8 layer_id: number, |
9 position: Array.<number>, | 9 position: Array.<number>, |
10 scroll_offset: Array.<number>, | 10 scroll_offset: Array.<number>, |
(...skipping 26 matching lines...) Expand all Loading... |
37 /** | 37 /** |
38 * @constructor | 38 * @constructor |
39 * @extends {WebInspector.LayerTreeBase} | 39 * @extends {WebInspector.LayerTreeBase} |
40 * @param {?WebInspector.Target} target | 40 * @param {?WebInspector.Target} target |
41 */ | 41 */ |
42 WebInspector.TracingLayerTree = function(target) | 42 WebInspector.TracingLayerTree = function(target) |
43 { | 43 { |
44 WebInspector.LayerTreeBase.call(this, target); | 44 WebInspector.LayerTreeBase.call(this, target); |
45 /** @type {!Map.<string, !WebInspector.TracingLayerTile>} */ | 45 /** @type {!Map.<string, !WebInspector.TracingLayerTile>} */ |
46 this._tileById = new Map(); | 46 this._tileById = new Map(); |
47 } | 47 }; |
48 | 48 |
49 WebInspector.TracingLayerTree.prototype = { | 49 WebInspector.TracingLayerTree.prototype = { |
50 /** | 50 /** |
51 * @param {?WebInspector.TracingLayerPayload} root | 51 * @param {?WebInspector.TracingLayerPayload} root |
52 * @param {?Array<!WebInspector.TracingLayerPayload>} layers | 52 * @param {?Array<!WebInspector.TracingLayerPayload>} layers |
53 * @param {!Array<!WebInspector.LayerPaintEvent>} paints | 53 * @param {!Array<!WebInspector.LayerPaintEvent>} paints |
54 * @param {function()} callback | 54 * @param {function()} callback |
55 */ | 55 */ |
56 setLayers: function(root, layers, paints, callback) | 56 setLayers: function(root, layers, paints, callback) |
57 { | 57 { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload) | 162 _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload) |
163 { | 163 { |
164 var backendNodeId = payload.owner_node; | 164 var backendNodeId = payload.owner_node; |
165 if (backendNodeId && !this._backendNodeIdToNode.has(backendNodeId)) | 165 if (backendNodeId && !this._backendNodeIdToNode.has(backendNodeId)) |
166 nodeIdsToResolve.add(backendNodeId); | 166 nodeIdsToResolve.add(backendNodeId); |
167 for (var i = 0; payload.children && i < payload.children.length; ++i) | 167 for (var i = 0; payload.children && i < payload.children.length; ++i) |
168 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload
.children[i]); | 168 this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload
.children[i]); |
169 }, | 169 }, |
170 | 170 |
171 __proto__: WebInspector.LayerTreeBase.prototype | 171 __proto__: WebInspector.LayerTreeBase.prototype |
172 } | 172 }; |
173 | 173 |
174 /** | 174 /** |
175 * @constructor | 175 * @constructor |
176 * @param {!WebInspector.TracingLayerPayload} payload | 176 * @param {!WebInspector.TracingLayerPayload} payload |
177 * @implements {WebInspector.Layer} | 177 * @implements {WebInspector.Layer} |
178 */ | 178 */ |
179 WebInspector.TracingLayer = function(payload) | 179 WebInspector.TracingLayer = function(payload) |
180 { | 180 { |
181 this._reset(payload); | 181 this._reset(payload); |
182 } | 182 }; |
183 | 183 |
184 WebInspector.TracingLayer.prototype = { | 184 WebInspector.TracingLayer.prototype = { |
185 /** | 185 /** |
186 * @param {!WebInspector.TracingLayerPayload} payload | 186 * @param {!WebInspector.TracingLayerPayload} payload |
187 */ | 187 */ |
188 _reset: function(payload) | 188 _reset: function(payload) |
189 { | 189 { |
190 /** @type {?WebInspector.DOMNode} */ | 190 /** @type {?WebInspector.DOMNode} */ |
191 this._node = null; | 191 this._node = null; |
192 this._layerId = String(payload.layer_id); | 192 this._layerId = String(payload.layer_id); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 }, | 489 }, |
490 | 490 |
491 /** | 491 /** |
492 * @override | 492 * @override |
493 * @return {boolean} | 493 * @return {boolean} |
494 */ | 494 */ |
495 drawsContent: function() | 495 drawsContent: function() |
496 { | 496 { |
497 return this._drawsContent; | 497 return this._drawsContent; |
498 } | 498 } |
499 } | 499 }; |
OLD | NEW |