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 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/debug/lap_timer.h" | 14 #include "cc/debug/lap_timer.h" |
15 #include "cc/debug/rasterize_and_record_benchmark_impl.h" | 15 #include "cc/debug/rasterize_and_record_benchmark_impl.h" |
16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
17 #include "cc/layers/picture_layer.h" | 17 #include "cc/layers/picture_layer.h" |
18 #include "cc/trees/layer_tree_host.h" | 18 #include "cc/trees/layer_tree_host.h" |
19 #include "cc/trees/layer_tree_host_common.h" | 19 #include "cc/trees/layer_tree_host_common.h" |
20 #include "ui/gfx/rect.h" | 20 #include "ui/gfx/rect.h" |
21 | 21 |
22 namespace cc { | 22 namespace cc { |
23 | 23 |
24 namespace { | 24 namespace { |
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 "", |
| 30 "_sk_null_canvas", |
| 31 "_painting_disabled"}; |
30 | 32 |
31 } // namespace | 33 } // namespace |
32 | 34 |
33 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark( | 35 RasterizeAndRecordBenchmark::RasterizeAndRecordBenchmark( |
34 scoped_ptr<base::Value> value, | 36 scoped_ptr<base::Value> value, |
35 const MicroBenchmark::DoneCallback& callback) | 37 const MicroBenchmark::DoneCallback& callback) |
36 : MicroBenchmark(callback), | 38 : MicroBenchmark(callback), |
37 record_repeat_count_(kDefaultRecordRepeatCount), | 39 record_repeat_count_(kDefaultRecordRepeatCount), |
38 settings_(value.Pass()), | 40 settings_(value.Pass()), |
39 main_thread_benchmark_done_(false), | 41 main_thread_benchmark_done_(false), |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 record_results_.total_best_time[mode_index] += min_time; | 148 record_results_.total_best_time[mode_index] += min_time; |
147 } | 149 } |
148 } | 150 } |
149 | 151 |
150 RasterizeAndRecordBenchmark::RecordResults::RecordResults() | 152 RasterizeAndRecordBenchmark::RecordResults::RecordResults() |
151 : pixels_recorded(0) {} | 153 : pixels_recorded(0) {} |
152 | 154 |
153 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} | 155 RasterizeAndRecordBenchmark::RecordResults::~RecordResults() {} |
154 | 156 |
155 } // namespace cc | 157 } // namespace cc |
OLD | NEW |