| 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 Run(Layer* layer); | 40 void Run(Layer* layer); |
| 41 void RunOnDisplayListLayer(PictureLayer* layer); |
| 41 | 42 |
| 42 void RecordRasterResults(scoped_ptr<base::Value> results); | 43 void RecordRasterResults(scoped_ptr<base::Value> results); |
| 43 | 44 |
| 44 struct RecordResults { | 45 struct RecordResults { |
| 45 RecordResults(); | 46 RecordResults(); |
| 46 ~RecordResults(); | 47 ~RecordResults(); |
| 47 | 48 |
| 48 int pixels_recorded; | 49 int pixels_recorded; |
| 49 size_t bytes_used; | 50 size_t bytes_used; |
| 50 base::TimeDelta total_best_time[Picture::RECORDING_MODE_COUNT]; | 51 base::TimeDelta total_best_time[Picture::RECORDING_MODE_COUNT]; |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 RecordResults record_results_; | 54 RecordResults record_results_; |
| 54 int record_repeat_count_; | 55 int record_repeat_count_; |
| 55 scoped_ptr<base::Value> settings_; | 56 scoped_ptr<base::Value> settings_; |
| 56 scoped_ptr<base::DictionaryValue> results_; | 57 scoped_ptr<base::DictionaryValue> results_; |
| 57 | 58 |
| 58 // The following is used in DCHECKs. | 59 // The following is used in DCHECKs. |
| 59 bool main_thread_benchmark_done_; | 60 bool main_thread_benchmark_done_; |
| 60 | 61 |
| 61 LayerTreeHost* host_; | 62 LayerTreeHost* host_; |
| 62 | 63 |
| 63 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; | 64 base::WeakPtrFactory<RasterizeAndRecordBenchmark> weak_ptr_factory_; |
| 64 }; | 65 }; |
| 65 | 66 |
| 66 } // namespace cc | 67 } // namespace cc |
| 67 | 68 |
| 68 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ | 69 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
| OLD | NEW |