diff options
author | fmalita@chromium.org <fmalita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 14:57:55 +0000 |
---|---|---|
committer | fmalita@chromium.org <fmalita@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 14:57:55 +0000 |
commit | 1a22d622c077d30e7e5f7c74701dc7545d188b61 (patch) | |
tree | 504dacc1f68f5a3cbe9b012ac122c60b51268128 /skia/ext/benchmarking_canvas.cc | |
parent | 84ea09dd546b7f7dfc0f3b40116de6242a9c60c0 (diff) | |
download | chromium_src-1a22d622c077d30e7e5f7c74701dc7545d188b61.zip chromium_src-1a22d622c077d30e7e5f7c74701dc7545d188b61.tar.gz chromium_src-1a22d622c077d30e7e5f7c74701dc7545d188b61.tar.bz2 |
[skia_benchmarking_extension] fix off-by-one timing reporting.
Just in case you were wondering why that translate(0, 0) shows up as more expensive than a drawBitmapRect() :)
TBR=senorblanco@chromium.org
Review URL: https://codereview.chromium.org/22424003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/benchmarking_canvas.cc')
-rw-r--r-- | skia/ext/benchmarking_canvas.cc | 3 |
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; } |