Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {WebInspector.VBox} | 9 * @extends {WebInspector.VBox} |
| 10 */ | 10 */ |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 36 }, | 36 }, |
| 37 | 37 |
| 38 wasShown: function() | 38 wasShown: function() |
| 39 { | 39 { |
| 40 if (this._updateWhenVisible) { | 40 if (this._updateWhenVisible) { |
| 41 this._updateWhenVisible = false; | 41 this._updateWhenVisible = false; |
| 42 this._update(); | 42 this._update(); |
| 43 } | 43 } |
| 44 }, | 44 }, |
| 45 | 45 |
| 46 /** | |
| 47 * @param {!function(!WebInspector.TracingModel.Event)} callback | |
| 48 */ | |
| 49 setSelectPaintEventCallback: function(callback) | |
|
caseq
2014/07/17 13:12:22
I'd rather pass TimelineModeViewDelegate here, it
malch
2014/07/17 15:17:44
Done.
| |
| 50 { | |
| 51 this._layers3DView.setSelectPaintEventCallback(callback); | |
| 52 }, | |
| 53 | |
| 46 _update: function() | 54 _update: function() |
| 47 { | 55 { |
| 48 var layerTree; | 56 var layerTree; |
| 49 | 57 |
| 50 this._weakTarget = this._deferredLayerTree.weakTarget(); | 58 this._weakTarget = this._deferredLayerTree.weakTarget(); |
| 51 var originalTiles = this._paintTiles; | 59 var originalTiles = this._paintTiles; |
| 52 var tilesReadyBarrier = new CallbackBarrier(); | 60 var tilesReadyBarrier = new CallbackBarrier(); |
| 53 this._deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayer sReady)); | 61 this._deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayer sReady)); |
| 54 var target = this._weakTarget.get(); | 62 var target = this._weakTarget.get(); |
| 55 if (target) { | 63 if (target) { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 73 */ | 81 */ |
| 74 function onSnapshotLoaded(paintEvent, snapshot) | 82 function onSnapshotLoaded(paintEvent, snapshot) |
| 75 { | 83 { |
| 76 if (!snapshot) | 84 if (!snapshot) |
| 77 return; | 85 return; |
| 78 // We're too late and there's a new generation of tiles being loaded . | 86 // We're too late and there's a new generation of tiles being loaded . |
| 79 if (originalTiles !== this._paintTiles) { | 87 if (originalTiles !== this._paintTiles) { |
| 80 snapshot.dispose(); | 88 snapshot.dispose(); |
| 81 return; | 89 return; |
| 82 } | 90 } |
| 83 this._paintTiles.push({layerId: paintEvent.layerId, rect: paintEvent .rect, snapshot: snapshot}); | 91 this._paintTiles.push({layerId: paintEvent.layerId, rect: paintEvent .rect, snapshot: snapshot, traceEvent: paintEvent.traceEvent}); |
| 84 } | 92 } |
| 85 | 93 |
| 86 /** | 94 /** |
| 87 * @this {WebInspector.TimelineLayersView} | 95 * @this {WebInspector.TimelineLayersView} |
| 88 */ | 96 */ |
| 89 function onLayersAndTilesReady() | 97 function onLayersAndTilesReady() |
| 90 { | 98 { |
| 91 this._layers3DView.setLayerTree(layerTree); | 99 this._layers3DView.setLayerTree(layerTree); |
| 92 this._layers3DView.setTiles(this._paintTiles); | 100 this._layers3DView.setTiles(this._paintTiles); |
| 93 } | 101 } |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 154 | 162 |
| 155 _disposeTiles: function() | 163 _disposeTiles: function() |
| 156 { | 164 { |
| 157 for (var i = 0; i < this._paintTiles.length; ++i) | 165 for (var i = 0; i < this._paintTiles.length; ++i) |
| 158 this._paintTiles[i].snapshot.dispose(); | 166 this._paintTiles[i].snapshot.dispose(); |
| 159 this._paintTiles = []; | 167 this._paintTiles = []; |
| 160 }, | 168 }, |
| 161 | 169 |
| 162 __proto__: WebInspector.VBox.prototype | 170 __proto__: WebInspector.VBox.prototype |
| 163 } | 171 } |
| OLD | NEW |