OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |