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

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

Issue 676663002: Paint Profiler: fix right boundary of selection window (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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: Source/devtools/front_end/timeline/PaintProfilerView.js
diff --git a/Source/devtools/front_end/timeline/PaintProfilerView.js b/Source/devtools/front_end/timeline/PaintProfilerView.js
index 57b4cbd2435d159ead84d6218d1ae4a1e12cd42e..fd48a129636723bb7e5259f5ef41b58d7b31fb9b 100644
--- a/Source/devtools/front_end/timeline/PaintProfilerView.js
+++ b/Source/devtools/front_end/timeline/PaintProfilerView.js
@@ -178,7 +178,7 @@ WebInspector.PaintProfilerView.prototype = {
var window = this.windowBoundaries();
var totalTime = 0;
var timeByCategory = {};
- for (var i = window.left; i <= window.right; ++i) {
+ for (var i = window.left; i < window.right; ++i) {
var logEntry = this._log[i];
var category = WebInspector.PaintProfilerView._categoryForLogItem(logEntry);
timeByCategory[category.color] = timeByCategory[category.color] || 0;
@@ -213,10 +213,10 @@ WebInspector.PaintProfilerView.prototype = {
{
var screenLeft = this._selectionWindow.windowLeft * this._canvas.width;
var screenRight = this._selectionWindow.windowRight * this._canvas.width;
- var barLeft = Math.floor((screenLeft - this._barPaddingWidth) / this._outerBarWidth);
- var barRight = Math.floor((screenRight - this._barPaddingWidth + this._innerBarWidth)/ this._outerBarWidth);
+ var barLeft = Math.floor(screenLeft / this._outerBarWidth);
+ var barRight = Math.floor((screenRight + this._innerBarWidth - this._barPaddingWidth / 2) / this._outerBarWidth);
var stepLeft = Number.constrain(barLeft * this._samplesPerBar, 0, this._log.length - 1);
- var stepRight = Number.constrain(barRight * this._samplesPerBar, 0, this._log.length - 1);
+ var stepRight = Number.constrain(barRight * this._samplesPerBar, 0, this._log.length);
return { left: stepLeft, right: stepRight };
},
@@ -228,7 +228,7 @@ WebInspector.PaintProfilerView.prototype = {
return;
var window = this.windowBoundaries();
- this._snapshot.requestImage(this._log[window.left].commandIndex, this._log[window.right].commandIndex, 1, this._showImageCallback);
+ this._snapshot.requestImage(this._log[window.left].commandIndex, this._log[window.right - 1].commandIndex, 1, this._showImageCallback);
},
_reset: function()
@@ -291,8 +291,8 @@ WebInspector.PaintProfilerCommandLogView.prototype = {
if (!this._log)
return;
stepLeft = stepLeft || 0;
- stepRight = stepRight || this._log.length - 1;
- for (var i = stepLeft; i <= stepRight; ++i)
+ stepRight = stepRight || this._log.length;
+ for (var i = stepLeft; i < stepRight; ++i)
this._appendLogItem(this.sidebarTree, this._log[i]);
},
« 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