| 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_PICTURE_RECORD_BENCHMARK_H_ | 5 #ifndef CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_ |
| 6 #define CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_ | 6 #define CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "cc/debug/micro_benchmark_controller.h" | 13 #include "cc/debug/micro_benchmark_controller.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 | 16 |
| 17 class LayerTreeHost; | 17 class LayerTreeHost; |
| 18 class Layer; | 18 class Layer; |
| 19 class PictureRecordBenchmark : public MicroBenchmark { | 19 class CC_EXPORT PictureRecordBenchmark : public MicroBenchmark { |
| 20 public: | 20 public: |
| 21 explicit PictureRecordBenchmark(scoped_ptr<base::Value> value, | 21 explicit PictureRecordBenchmark(scoped_ptr<base::Value> value, |
| 22 const MicroBenchmark::DoneCallback& callback); | 22 const MicroBenchmark::DoneCallback& callback); |
| 23 virtual ~PictureRecordBenchmark(); | 23 virtual ~PictureRecordBenchmark(); |
| 24 | 24 |
| 25 // Implements MicroBenchmark interface. | 25 // Implements MicroBenchmark interface. |
| 26 virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE; | 26 virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE; |
| 27 virtual void RunOnLayer(PictureLayer* layer) OVERRIDE; | 27 virtual void RunOnLayer(PictureLayer* layer) OVERRIDE; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 void Run(Layer* layer); | 30 void Run(Layer* layer); |
| 31 | 31 |
| 32 typedef std::pair<base::TimeDelta, unsigned> TotalTime; | 32 typedef std::pair<base::TimeDelta, unsigned> TotalTime; |
| 33 std::map<std::pair<int, int>, TotalTime> times_; | 33 std::map<std::pair<int, int>, TotalTime> times_; |
| 34 std::vector<std::pair<int, int> > dimensions_; | 34 std::vector<std::pair<int, int> > dimensions_; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace cc | 37 } // namespace cc |
| 38 | 38 |
| 39 #endif // CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_ | 39 #endif // CC_DEBUG_PICTURE_RECORD_BENCHMARK_H_ |
| OLD | NEW |