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

Side by Side Diff: cc/debug/rasterize_and_record_benchmark.cc

Issue 300963004: cc: Add message passing mechanism to micro benchmarking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/debug/rasterize_and_record_benchmark.h" 5 #include "cc/debug/rasterize_and_record_benchmark.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <string> 9 #include <string>
10 10
(...skipping 14 matching lines...) Expand all
25 25
26 const int kDefaultRecordRepeatCount = 100; 26 const int kDefaultRecordRepeatCount = 100;
27 27
28 const char* kModeSuffixes[Picture::RECORDING_MODE_COUNT] = { 28 const char* kModeSuffixes[Picture::RECORDING_MODE_COUNT] = {
29 "", "_sk_null_canvas", "_painting_disabled", "_skrecord"}; 29 "", "_sk_null_canvas", "_painting_disabled", "_skrecord"};
30 30
31 } // namespace 31 } // namespace
32 32
33 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark( 33 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark(
34 scoped_ptr<base::Value> value, 34 scoped_ptr<base::Value> value,
35 const MicroBenchmark::DoneCallback& callback) 35 const MicroBenchmark::DoneCallback& callback,
36 : MicroBenchmark(callback), 36 int id)
37 : MicroBenchmark(callback, id),
37 record_repeat_count_(kDefaultRecordRepeatCount), 38 record_repeat_count_(kDefaultRecordRepeatCount),
38 settings_(value.Pass()), 39 settings_(value.Pass()),
39 main_thread_benchmark_done_(false), 40 main_thread_benchmark_done_(false),
40 host_(NULL), 41 host_(NULL),
41 weak_ptr_factory_(this) { 42 weak_ptr_factory_(this) {
42 base::DictionaryValue* settings = NULL; 43 base::DictionaryValue* settings = NULL;
43 settings_->GetAsDictionary(&settings); 44 settings_->GetAsDictionary(&settings);
44 if (!settings) 45 if (!settings)
45 return; 46 return;
46 47
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 record_results_.total_best_time[mode_index] += min_time; 147 record_results_.total_best_time[mode_index] += min_time;
147 } 148 }
148 } 149 }
149 150
150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() 151 RasterizeAndRecordBenchmark::RecordResults::RecordResults()
151 : pixels_recorded(0) {} 152 : pixels_recorded(0) {}
152 153
153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} 154 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {}
154 155
155 } // namespace cc 156 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698