summaryrefslogtreecommitdiffstats
path: root/skia/ext/benchmarking_canvas.cc
diff options
context:
space:
mode:
Diffstat (limited to 'skia/ext/benchmarking_canvas.cc')
-rw-r--r--skia/ext/benchmarking_canvas.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/skia/ext/benchmarking_canvas.cc b/skia/ext/benchmarking_canvas.cc
index 6039515..d83252b 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;
}