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

Unified Diff: skia/ext/benchmarking_canvas.cc

Issue 22424003: [skia_benchmarking_extension] fix off-by-one timing reporting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« 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: skia/ext/benchmarking_canvas.cc
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index 60395158cb2096148951ca0c46704d14f7eb162e..d83252b4c553a7f734ff29c8758fc22dcac43bf7 100644
--- a/skia/ext/benchmarking_canvas.cc
+++ b/skia/ext/benchmarking_canvas.cc
@@ -203,7 +203,8 @@ AutoStamper::AutoStamper(TimingCanvas *timing_canvas)
AutoStamper::~AutoStamper() {
base::TimeDelta delta = base::TimeTicks::HighResNow() - start_ticks_;
- int command_index = timing_canvas_->tracking_canvas_->CommandCount();
+ int command_index = timing_canvas_->tracking_canvas_->CommandCount() - 1;
+ DCHECK_GE(command_index, 0);
timing_canvas_->timings_map_[command_index] = delta;
}
« 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