Commit 6ecc09b7 authored by alph's avatar alph Committed by Commit bot

DevTools: Move GPU activity on timeline out of experiment.

BUG=298951

Review URL: https://codereview.chromium.org/1815573002

Cr-Commit-Position: refs/heads/master@{#381866}
parent 86c916bd
...@@ -109,7 +109,6 @@ WebInspector.Main.prototype = { ...@@ -109,7 +109,6 @@ WebInspector.Main.prototype = {
Runtime.experiments.register("colorContrastRatio", "Contrast ratio line in color picker", true); Runtime.experiments.register("colorContrastRatio", "Contrast ratio line in color picker", true);
Runtime.experiments.register("cpuThrottling", "CPU throttling", true); Runtime.experiments.register("cpuThrottling", "CPU throttling", true);
Runtime.experiments.register("emptySourceMapAutoStepping", "Empty sourcemap auto-stepping"); Runtime.experiments.register("emptySourceMapAutoStepping", "Empty sourcemap auto-stepping");
Runtime.experiments.register("gpuTimeline", "GPU data on timeline", true);
Runtime.experiments.register("inputEventsOnTimelineOverview", "Input events on Timeline overview", true); Runtime.experiments.register("inputEventsOnTimelineOverview", "Input events on Timeline overview", true);
Runtime.experiments.register("layersPanel", "Layers panel"); Runtime.experiments.register("layersPanel", "Layers panel");
Runtime.experiments.register("layoutEditor", "Layout editor", true); Runtime.experiments.register("layoutEditor", "Layout editor", true);
......
...@@ -44,10 +44,8 @@ WebInspector.MemoryCountersGraph = function(delegate, model, filters) ...@@ -44,10 +44,8 @@ WebInspector.MemoryCountersGraph = function(delegate, model, filters)
this._countersByName["documents"] = this.createCounter(WebInspector.UIString("Documents"), WebInspector.UIString("Documents: %s"), "hsl(0, 90%, 43%)"); this._countersByName["documents"] = this.createCounter(WebInspector.UIString("Documents"), WebInspector.UIString("Documents: %s"), "hsl(0, 90%, 43%)");
this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("Nodes"), WebInspector.UIString("Nodes: %s"), "hsl(120, 90%, 43%)"); this._countersByName["nodes"] = this.createCounter(WebInspector.UIString("Nodes"), WebInspector.UIString("Nodes: %s"), "hsl(120, 90%, 43%)");
this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.UIString("Listeners"), WebInspector.UIString("Listeners: %s"), "hsl(38, 90%, 43%)"); this._countersByName["jsEventListeners"] = this.createCounter(WebInspector.UIString("Listeners"), WebInspector.UIString("Listeners: %s"), "hsl(38, 90%, 43%)");
if (Runtime.experiments.isEnabled("gpuTimeline")) { this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU Memory"), WebInspector.UIString("GPU Memory [KB]: %s"), "hsl(300, 90%, 43%)", Number.bytesToString);
this._gpuMemoryCounter = this.createCounter(WebInspector.UIString("GPU Memory"), WebInspector.UIString("GPU Memory [KB]: %s"), "hsl(300, 90%, 43%)", Number.bytesToString); this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter;
this._countersByName["gpuMemoryUsedKB"] = this._gpuMemoryCounter;
}
} }
WebInspector.MemoryCountersGraph.prototype = { WebInspector.MemoryCountersGraph.prototype = {
...@@ -73,7 +71,7 @@ WebInspector.MemoryCountersGraph.prototype = { ...@@ -73,7 +71,7 @@ WebInspector.MemoryCountersGraph.prototype = {
} }
var gpuMemoryLimitCounterName = "gpuMemoryLimitKB"; var gpuMemoryLimitCounterName = "gpuMemoryLimitKB";
if (this._gpuMemoryCounter && (gpuMemoryLimitCounterName in counters)) if (gpuMemoryLimitCounterName in counters)
this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]); this._gpuMemoryCounter.setLimit(counters[gpuMemoryLimitCounterName]);
} }
this.scheduleRefresh(); this.scheduleRefresh();
......
...@@ -395,10 +395,9 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { ...@@ -395,10 +395,9 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
for (var i = 0; i < compositorThreads.length; ++i) for (var i = 0; i < compositorThreads.length; ++i)
this._appendSyncEvents(compositorThreads[i].events, WebInspector.UIString("Rasterizer Thread %d", i), this._headerLevel2); this._appendSyncEvents(compositorThreads[i].events, WebInspector.UIString("Rasterizer Thread %d", i), this._headerLevel2);
} }
this._appendGPUEvents();
this._appendThreadTimelineData(WebInspector.UIString("Main Thread"), this._model.mainThreadEvents(), this._model.mainThreadAsyncEvents(), true); this._appendThreadTimelineData(WebInspector.UIString("Main Thread"), this._model.mainThreadEvents(), this._model.mainThreadAsyncEvents(), true);
if (Runtime.experiments.isEnabled("gpuTimeline"))
this._appendGPUEvents();
otherThreads.forEach(thread => this._appendThreadTimelineData(thread.name, thread.events, thread.asyncEventsByGroup)); otherThreads.forEach(thread => this._appendThreadTimelineData(thread.name, thread.events, thread.asyncEventsByGroup));
...@@ -546,7 +545,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = { ...@@ -546,7 +545,7 @@ WebInspector.TimelineFlameChartDataProvider.prototype = {
_appendGPUEvents: function() _appendGPUEvents: function()
{ {
if (this._appendSyncEvents(this._model.gpuTasks().map(record => record.traceEvent()), WebInspector.UIString("GPU"), this._headerLevel1)) if (this._appendSyncEvents(this._model.gpuEvents(), WebInspector.UIString("GPU"), this._headerLevel1, false))
++this._currentLevel; ++this._currentLevel;
}, },
......
...@@ -501,7 +501,7 @@ WebInspector.TimelineModel.prototype = { ...@@ -501,7 +501,7 @@ WebInspector.TimelineModel.prototype = {
this._cpuProfiles = null; this._cpuProfiles = null;
this._processBrowserEvents(tracingModel); this._processBrowserEvents(tracingModel);
this._buildTimelineRecords(); this._buildTimelineRecords();
this._buildGPUTasks(tracingModel); this._buildGPUEvents(tracingModel);
this._insertFirstPaintEvent(); this._insertFirstPaintEvent();
this._resetProcessingState(); this._resetProcessingState();
}, },
...@@ -645,17 +645,13 @@ WebInspector.TimelineModel.prototype = { ...@@ -645,17 +645,13 @@ WebInspector.TimelineModel.prototype = {
/** /**
* @param {!WebInspector.TracingModel} tracingModel * @param {!WebInspector.TracingModel} tracingModel
*/ */
_buildGPUTasks: function(tracingModel) _buildGPUEvents: function(tracingModel)
{ {
var mainThread = tracingModel.threadByName("GPU Process", "CrGpuMain"); var thread = tracingModel.threadByName("GPU Process", "CrGpuMain");
if (!mainThread) if (!thread)
return; return;
var events = mainThread.events(); var gpuEventName = WebInspector.TimelineModel.RecordType.GPUTask;
var recordTypes = WebInspector.TimelineModel.RecordType; this._gpuEvents = thread.events().filter(event => event.name === gpuEventName);
for (var i = 0; i < events.length; ++i) {
if (events[i].name === recordTypes.GPUTask)
this._gpuTasks.push(new WebInspector.TimelineModel.Record(events[i]));
}
}, },
/** /**
...@@ -1066,19 +1062,19 @@ WebInspector.TimelineModel.prototype = { ...@@ -1066,19 +1062,19 @@ WebInspector.TimelineModel.prototype = {
{ {
this._lineLevelCPUProfile = new WebInspector.TimelineModel.LineLevelProfile(); this._lineLevelCPUProfile = new WebInspector.TimelineModel.LineLevelProfile();
this._virtualThreads = []; this._virtualThreads = [];
/** @type {!Array.<!WebInspector.TracingModel.Event>} */ /** @type {!Array<!WebInspector.TracingModel.Event>} */
this._mainThreadEvents = []; this._mainThreadEvents = [];
/** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */ /** @type {!Map<!WebInspector.AsyncEventGroup, !Array<!WebInspector.TracingModel.AsyncEvent>>} */
this._mainThreadAsyncEventsByGroup = new Map(); this._mainThreadAsyncEventsByGroup = new Map();
/** @type {!Array.<!WebInspector.TracingModel.Event>} */ /** @type {!Array<!WebInspector.TracingModel.Event>} */
this._inspectedTargetEvents = []; this._inspectedTargetEvents = [];
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */ /** @type {!Array<!WebInspector.TimelineModel.Record>} */
this._records = []; this._records = [];
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */ /** @type {!Array<!WebInspector.TimelineModel.Record>} */
this._mainThreadTasks = []; this._mainThreadTasks = [];
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */ /** @type {!Array<!WebInspector.TracingModel.Event>} */
this._gpuTasks = []; this._gpuEvents = [];
/** @type {!Array.<!WebInspector.TimelineModel.Record>} */ /** @type {!Array<!WebInspector.TimelineModel.Record>} */
this._eventDividerRecords = []; this._eventDividerRecords = [];
/** @type {?string} */ /** @type {?string} */
this._sessionId = null; this._sessionId = null;
...@@ -1169,11 +1165,11 @@ WebInspector.TimelineModel.prototype = { ...@@ -1169,11 +1165,11 @@ WebInspector.TimelineModel.prototype = {
}, },
/** /**
* @return {!Array.<!WebInspector.TimelineModel.Record>} * @return {!Array<!WebInspector.TracingModel.Event>}
*/ */
gpuTasks: function() gpuEvents: function()
{ {
return this._gpuTasks; return this._gpuEvents;
}, },
/** /**
......
...@@ -1477,7 +1477,7 @@ WebInspector.TimelineUIUtils.categories = function() ...@@ -1477,7 +1477,7 @@ WebInspector.TimelineUIUtils.categories = function()
scripting: new WebInspector.TimelineCategory("scripting", WebInspector.UIString("Scripting"), true, "hsl(43, 83%, 72%)", "hsl(43, 83%, 64%) "), scripting: new WebInspector.TimelineCategory("scripting", WebInspector.UIString("Scripting"), true, "hsl(43, 83%, 72%)", "hsl(43, 83%, 64%) "),
rendering: new WebInspector.TimelineCategory("rendering", WebInspector.UIString("Rendering"), true, "hsl(256, 67%, 76%)", "hsl(256, 67%, 70%)"), rendering: new WebInspector.TimelineCategory("rendering", WebInspector.UIString("Rendering"), true, "hsl(256, 67%, 76%)", "hsl(256, 67%, 70%)"),
painting: new WebInspector.TimelineCategory("painting", WebInspector.UIString("Painting"), true, "hsl(109, 33%, 64%)", "hsl(109, 33%, 55%)"), painting: new WebInspector.TimelineCategory("painting", WebInspector.UIString("Painting"), true, "hsl(109, 33%, 64%)", "hsl(109, 33%, 55%)"),
gpu: new WebInspector.TimelineCategory("gpu", WebInspector.UIString("GPU"), false, "hsl(240, 24%, 73%)", "hsl(240, 24%, 66%)"), gpu: new WebInspector.TimelineCategory("gpu", WebInspector.UIString("GPU"), false, "hsl(109, 33%, 64%)", "hsl(109, 33%, 55%)"),
other: new WebInspector.TimelineCategory("other", WebInspector.UIString("Other"), false, "hsl(0, 0%, 87%)", "hsl(0, 0%, 79%)"), other: new WebInspector.TimelineCategory("other", WebInspector.UIString("Other"), false, "hsl(0, 0%, 87%)", "hsl(0, 0%, 79%)"),
idle: new WebInspector.TimelineCategory("idle", WebInspector.UIString("Idle"), false, "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)") idle: new WebInspector.TimelineCategory("idle", WebInspector.UIString("Idle"), false, "hsl(0, 100%, 100%)", "hsl(0, 100%, 100%)")
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment