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

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js

Issue 2408023002: [Devtools] Added row decoration to canvas timeline experiment (Closed)
Patch Set: rebase Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
index 4337f1f52443d8b363e9d12698d6fc9d0c80ae83..2b516fe9c97d73c247a4cdb8be16e572b5d56c41 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js
@@ -157,6 +157,8 @@ WebInspector.NetworkTimelineColumn.prototype = {
var lastRequestIndex = Math.min(requests.length, firstRequestIndex + Math.ceil(this._offsetHeight / rowHeight));
for (var i = firstRequestIndex; i < lastRequestIndex; i++) {
var rowOffset = rowHeight * i;
+ var rowNumber = i - firstRequestIndex;
+ this._decorateRow(context, rowNumber, rowOffset - scrollTop, rowHeight);
var request = requests[i];
var ranges = WebInspector.RequestTimingView.calculateRequestTimeRanges(request, 0);
for (var range of ranges) {
@@ -232,5 +234,24 @@ WebInspector.NetworkTimelineColumn.prototype = {
context.restore();
},
+ /**
+ * @param {!CanvasRenderingContext2D} context
+ * @param {number} rowNumber
+ * @param {number} y
+ * @param {number} rowHeight
+ */
+ _decorateRow: function(context, rowNumber, y, rowHeight)
+ {
+ context.save();
+ if (rowNumber % 2 === 1)
+ return;
+
+ context.beginPath();
+ context.fillStyle = WebInspector.themeSupport.patchColor("#f5f5f5", WebInspector.ThemeSupport.ColorUsage.Background);
+ context.rect(0, y, this._offsetWidth, rowHeight);
+ context.fill();
+ context.restore();
+ },
+
__proto__: WebInspector.VBox.prototype
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698