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 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ | 5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ | 6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 11 matching lines...) Expand all Loading... |
22 class DictionaryValue; | 22 class DictionaryValue; |
23 } | 23 } |
24 | 24 |
25 namespace cc { | 25 namespace cc { |
26 | 26 |
27 class LayerTreeHost; | 27 class LayerTreeHost; |
28 class Layer; | 28 class Layer; |
29 class RasterizeAndRecordBenchmark : public MicroBenchmark { | 29 class RasterizeAndRecordBenchmark : public MicroBenchmark { |
30 public: | 30 public: |
31 explicit RasterizeAndRecordBenchmark( | 31 explicit RasterizeAndRecordBenchmark( |
32 scoped_ptr<base::Value> value, | 32 std::unique_ptr<base::Value> value, |
33 const MicroBenchmark::DoneCallback& callback); | 33 const MicroBenchmark::DoneCallback& callback); |
34 ~RasterizeAndRecordBenchmark() override; | 34 ~RasterizeAndRecordBenchmark() override; |
35 | 35 |
36 // Implements MicroBenchmark interface. | 36 // Implements MicroBenchmark interface. |
37 void DidUpdateLayers(LayerTreeHost* host) override; | 37 void DidUpdateLayers(LayerTreeHost* host) override; |
38 void RunOnLayer(PictureLayer* layer) override; | 38 void RunOnLayer(PictureLayer* layer) override; |
39 | 39 |
40 scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( | 40 std::unique_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( |
41 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) override; | 41 scoped_refptr<base::SingleThreadTaskRunner> origin_task_runner) override; |
42 | 42 |
43 private: | 43 private: |
44 void RecordRasterResults(scoped_ptr<base::Value> results); | 44 void RecordRasterResults(std::unique_ptr<base::Value> results); |
45 | 45 |
46 struct RecordResults { | 46 struct RecordResults { |
47 RecordResults(); | 47 RecordResults(); |
48 ~RecordResults(); | 48 ~RecordResults(); |
49 | 49 |
50 int pixels_recorded; | 50 int pixels_recorded; |
51 size_t bytes_used; | 51 size_t bytes_used; |
52 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT]; | 52 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT]; |
53 }; | 53 }; |
54 | 54 |
55 RecordResults record_results_; | 55 RecordResults record_results_; |
56 int record_repeat_count_; | 56 int record_repeat_count_; |
57 scoped_ptr<base::Value> settings_; | 57 std::unique_ptr<base::Value> settings_; |
58 scoped_ptr<base::DictionaryValue> results_; | 58 std::unique_ptr<base::DictionaryValue> results_; |
59 | 59 |
60 // The following is used in DCHECKs. | 60 // The following is used in DCHECKs. |
61 bool main_thread_benchmark_done_; | 61 bool main_thread_benchmark_done_; |
62 | 62 |
63 LayerTreeHost* host_; | 63 LayerTreeHost* host_; |
64 | 64 |
65 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; | 65 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; |
66 }; | 66 }; |
67 | 67 |
68 } // namespace cc | 68 } // namespace cc |
69 | 69 |
70 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ | 70 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
OLD | NEW |