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 <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 // Implements MicroBenchmark interface. | 32 // Implements MicroBenchmark interface. |
33 void DidUpdateLayers(LayerTreeHost* host) override; | 33 void DidUpdateLayers(LayerTreeHost* host) override; |
34 void RunOnLayer(PictureLayer* layer) override; | 34 void RunOnLayer(PictureLayer* layer) override; |
35 | 35 |
36 scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( | 36 scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( |
37 scoped_refptr<base::MessageLoopProxy> origin_loop) override; | 37 scoped_refptr<base::MessageLoopProxy> origin_loop) override; |
38 | 38 |
39 private: | 39 private: |
40 void RunOnDisplayListLayer(PictureLayer* layer, | 40 void RunOnDisplayListLayer(PictureLayer* layer, |
41 const gfx::Rect& visible_content_rect); | 41 const gfx::Rect& visible_layer_rect); |
42 void RunOnPictureLayer(PictureLayer* layer, | 42 void RunOnPictureLayer(PictureLayer* layer, |
43 const gfx::Rect& visible_content_rect); | 43 const gfx::Rect& visible_layer_rect); |
44 | 44 |
45 void RecordRasterResults(scoped_ptr<base::Value> results); | 45 void RecordRasterResults(scoped_ptr<base::Value> results); |
46 | 46 |
47 struct RecordResults { | 47 struct RecordResults { |
48 RecordResults(); | 48 RecordResults(); |
49 ~RecordResults(); | 49 ~RecordResults(); |
50 | 50 |
51 int pixels_recorded; | 51 int pixels_recorded; |
52 size_t bytes_used; | 52 size_t bytes_used; |
53 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT]; | 53 base::TimeDelta total_best_time[RecordingSource::RECORDING_MODE_COUNT]; |
54 }; | 54 }; |
55 | 55 |
56 RecordResults record_results_; | 56 RecordResults record_results_; |
57 int record_repeat_count_; | 57 int record_repeat_count_; |
58 scoped_ptr<base::Value> settings_; | 58 scoped_ptr<base::Value> settings_; |
59 scoped_ptr<base::DictionaryValue> results_; | 59 scoped_ptr<base::DictionaryValue> results_; |
60 | 60 |
61 // The following is used in DCHECKs. | 61 // The following is used in DCHECKs. |
62 bool main_thread_benchmark_done_; | 62 bool main_thread_benchmark_done_; |
63 | 63 |
64 LayerTreeHost* host_; | 64 LayerTreeHost* host_; |
65 | 65 |
66 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; | 66 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; |
67 }; | 67 }; |
68 | 68 |
69 } // namespace cc | 69 } // namespace cc |
70 | 70 |
71 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ | 71 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
OLD | NEW |