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

Unified Diff: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js

Issue 2242023002: DevTools: Timeline warning colors should scale with severity. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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: third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
index 18c519f991c79a99b35a34fbef31934127bb468f..e9de2646a6659fc820f3885b2c30e88c789c21d0 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/TimelineEventOverview.js
@@ -389,8 +389,7 @@ WebInspector.TimelineEventOverview.Responsiveness.prototype = {
var scale = this._canvas.width / timeSpan;
var frames = this._frameModel.frames();
var ctx = this._context;
- var fillPath = new Path2D();
- var markersPath = new Path2D();
+
for (var i = 0; i < frames.length; ++i) {
var frame = frames[i];
if (!frame.hasWarnings())
@@ -405,11 +404,6 @@ WebInspector.TimelineEventOverview.Responsiveness.prototype = {
paintWarningDecoration(events[i].startTime, events[i].duration);
}
- ctx.fillStyle = "hsl(0, 80%, 90%)";
- ctx.strokeStyle = "red";
- ctx.lineWidth = 2 * window.devicePixelRatio;
- ctx.fill(fillPath);
- ctx.stroke(markersPath);
/**
* @param {number} time
@@ -419,9 +413,18 @@ WebInspector.TimelineEventOverview.Responsiveness.prototype = {
{
var x = Math.round(scale * (time - timeOffset));
var w = Math.round(scale * duration);
- fillPath.rect(x, 0, w, height);
- markersPath.moveTo(x + w, 0);
- markersPath.lineTo(x + w, height);
+ var markersPath = new Path2D();
+
+ var overage = duration - 16;
caseq 2016/08/16 18:37:16 should we do it just for frames perhaps? how does
+ var intensity = Number.constrain(overage / (30 + overage), 0, 1).toFixed(3);
+ ctx.fillStyle = `hsla(0, 80%, 85%, ${intensity})`;
+ ctx.fillRect(x, 0, w, height);
+
+ markersPath.moveTo(x, 0);
+ markersPath.lineTo(x + w, 0);
+ ctx.strokeStyle = `hsla(0, 80%, 45%, ${intensity})`;
+ ctx.lineWidth = 2 * window.devicePixelRatio;
+ ctx.stroke(markersPath);
}
},

Powered by Google App Engine
This is Rietveld 408576698