Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1255)

Unified Diff: Source/devtools/front_end/timeline/TimelineLayersView.js

Issue 389563002: DevTools: make paint profiler target-aware (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/devtools/front_end/timeline/TimelineLayersView.js
diff --git a/Source/devtools/front_end/timeline/TimelineLayersView.js b/Source/devtools/front_end/timeline/TimelineLayersView.js
index e1080000f6a0be62833b223abcd82558494e5f86..6b61e57050a165af3f1c230a43f850fffb0b74a1 100644
--- a/Source/devtools/front_end/timeline/TimelineLayersView.js
+++ b/Source/devtools/front_end/timeline/TimelineLayersView.js
@@ -27,37 +27,32 @@ WebInspector.TimelineLayersView.prototype = {
showLayerTree: function(deferredLayerTree, paints)
{
this._disposeTiles();
- if (!this.isShowing()) {
- this._pendingLayerTree = deferredLayerTree,
- this._pendingPaints = paints;
- return;
- }
- this._actuallyShowLayerTree(deferredLayerTree, paints);
+ this._deferredLayerTree = deferredLayerTree;
+ this._paints = paints;
+ if (this.isShowing())
+ this._update();
+ else
+ this._updateWhenVisible = true;
},
wasShown: function()
{
- if (!this._pendingLayerTree)
- return;
- this._actuallyShowLayerTree(this._pendingLayerTree, this._pendingPaints);
- this._pendingLayerTree = null;
- this._pendingPaints = null;
+ if (this._updateWhenVisible) {
+ this._updateWhenVisible = false;
+ this._update();
+ }
},
- /**
- * @param {!WebInspector.DeferredLayerTree} deferredLayerTree
- * @param {?Array.<!WebInspector.LayerPaintEvent>} paints
- */
- _actuallyShowLayerTree: function(deferredLayerTree, paints)
+ _update: function()
{
var layerTree;
- this._target = deferredLayerTree.target();
+ this._target = this._deferredLayerTree.target();
var originalTiles = this._paintTiles;
var tilesReadyBarrier = new CallbackBarrier();
- deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayersReady));
- for (var i = 0; paints && i < paints.length; ++i)
- WebInspector.PaintProfilerSnapshot.load(paints[i].picture, tilesReadyBarrier.createCallback(onSnapshotLoaded.bind(this, paints[i])));
+ this._deferredLayerTree.resolve(tilesReadyBarrier.createCallback(onLayersReady));
+ for (var i = 0; this._paints && i < this._paints.length; ++i)
+ WebInspector.PaintProfilerSnapshot.load(this._target, this._paints[i].picture, tilesReadyBarrier.createCallback(onSnapshotLoaded.bind(this, this._paints[i])));
tilesReadyBarrier.callWhenDone(onLayersAndTilesReady.bind(this));
/**

Powered by Google App Engine
This is Rietveld 408576698