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

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

Issue 400643002: DevTools: Add ability to go to paint record and paint profiler in Timeline from layers view. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added annotations. 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 2159e2f34f855c58566a34924f72cbf8caa82424..b23a50c244f968ae197d91eff84712f08c0df289 100644
--- a/Source/devtools/front_end/timeline/TimelineLayersView.js
+++ b/Source/devtools/front_end/timeline/TimelineLayersView.js
@@ -16,6 +16,7 @@ WebInspector.TimelineLayersView = function()
this._layers3DView = new WebInspector.Layers3DView();
this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectSelected, this._onObjectSelected, this);
this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectHovered, this._onObjectHovered, this);
+ this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.JumpToPaintEventRequested, this._jumpToPaintEvent, this);
this._layers3DView.show(this.element);
}
@@ -43,6 +44,44 @@ WebInspector.TimelineLayersView.prototype = {
}
},
+ /**
+ * @param {!WebInspector.TimelineModel} model
+ * @param {!WebInspector.TimelineModeViewDelegate} delegate
+ */
+ setTimelineModelAndDelegate: function(model, delegate)
+ {
+ this._model = model;
+ this._delegate = delegate;
+ },
+
+ /**
+ * @param {!WebInspector.Event} event
+ */
+ _jumpToPaintEvent: function(event)
+ {
+ var traceEvent = event.data;
+ var eventRecord;
+
+ /**
+ * @param {!WebInspector.TimelineModel.Record} record
+ * @return {boolean}
+ */
+ function findRecordWithEvent(record)
+ {
+ if (record.traceEvent() === traceEvent) {
+ eventRecord = record;
+ return true;
+ }
+ return false;
+ }
+
+ this._model.forAllRecords(findRecordWithEvent);
+ if (eventRecord) {
+ var selection = WebInspector.TimelineSelection.fromRecord(eventRecord);
+ this._delegate.select(selection);
+ }
+ },
+
_update: function()
{
var layerTree;
@@ -79,7 +118,7 @@ WebInspector.TimelineLayersView.prototype = {
snapshot.dispose();
return;
}
- this._paintTiles.push({layerId: paintEvent.layerId, rect: paintEvent.rect, snapshot: snapshot});
+ this._paintTiles.push({layerId: paintEvent.layerId, rect: paintEvent.rect, snapshot: snapshot, traceEvent: paintEvent.traceEvent});
}
/**
« no previous file with comments | « Source/devtools/front_end/timeline/TimelineFrameModel.js ('k') | Source/devtools/front_end/timeline/TimelinePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698