OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
| 6 #define CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <utility> |
| 10 #include <vector> |
| 11 |
| 12 #include "base/time/time.h" |
| 13 #include "cc/debug/micro_benchmark_controller.h" |
| 14 |
| 15 namespace base { |
| 16 class DictionaryValue; |
| 17 } |
| 18 |
| 19 namespace cc { |
| 20 |
| 21 class LayerTreeHost; |
| 22 class Layer; |
| 23 class RasterizeAndRecordBenchmark : public MicroBenchmark { |
| 24 public: |
| 25 explicit RasterizeAndRecordBenchmark( |
| 26 scoped_ptr<base::Value> value, |
| 27 const MicroBenchmark::DoneCallback& callback); |
| 28 virtual ~RasterizeAndRecordBenchmark(); |
| 29 |
| 30 // Implements MicroBenchmark interface. |
| 31 virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE; |
| 32 virtual void RunOnLayer(PictureLayer* layer) OVERRIDE; |
| 33 |
| 34 virtual scoped_ptr<MicroBenchmarkImpl> CreateBenchmarkImpl( |
| 35 scoped_refptr<base::MessageLoopProxy> origin_loop) OVERRIDE; |
| 36 |
| 37 private: |
| 38 void Run(Layer* layer); |
| 39 |
| 40 void RecordRasterResults(scoped_ptr<base::Value> results); |
| 41 |
| 42 struct RecordResults { |
| 43 RecordResults(); |
| 44 ~RecordResults(); |
| 45 |
| 46 int pixels_recorded; |
| 47 base::TimeDelta total_best_time; |
| 48 }; |
| 49 |
| 50 RecordResults record_results_; |
| 51 int record_repeat_count_; |
| 52 scoped_ptr<base::Value> settings_; |
| 53 scoped_ptr<base::DictionaryValue> results_; |
| 54 |
| 55 // The following is used in DCHECKs. |
| 56 bool main_thread_benchmark_done_; |
| 57 }; |
| 58 |
| 59 } // namespace cc |
| 60 |
| 61 #endif // CC_DEBUG_RASTERIZE_AND_RECORD_BENCHMARK_H_ |
OLD | NEW |