| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_INVALIDATION_BENCHMARK_H_ | 5 #ifndef CC_DEBUG_INVALIDATION_BENCHMARK_H_ |
| 6 #define CC_DEBUG_INVALIDATION_BENCHMARK_H_ | 6 #define CC_DEBUG_INVALIDATION_BENCHMARK_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "cc/debug/micro_benchmark_controller.h" | 10 #include "cc/debug/micro_benchmark_controller.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 class LayerTreeHost; | 14 class LayerTreeHost; |
| 15 class Layer; | 15 class Layer; |
| 16 // NOTE: this benchmark will not measure or return any results, it will simply | 16 // NOTE: this benchmark will not measure or return any results, it will simply |
| 17 // invalidate a certain area of each layer every frame. It is intended to be | 17 // invalidate a certain area of each layer every frame. It is intended to be |
| 18 // used in combination with a telemetry benchmark that does the actual | 18 // used in combination with a telemetry benchmark that does the actual |
| 19 // measurement. | 19 // measurement. |
| 20 class CC_EXPORT InvalidationBenchmark : public MicroBenchmark { | 20 class CC_EXPORT InvalidationBenchmark : public MicroBenchmark { |
| 21 public: | 21 public: |
| 22 explicit InvalidationBenchmark(scoped_ptr<base::Value> value, | 22 explicit InvalidationBenchmark(scoped_ptr<base::Value> value, |
| 23 const MicroBenchmark::DoneCallback& callback); | 23 const MicroBenchmark::DoneCallback& callback); |
| 24 virtual ~InvalidationBenchmark(); | 24 virtual ~InvalidationBenchmark(); |
| 25 | 25 |
| 26 // Implements MicroBenchmark interface. | 26 // Implements MicroBenchmark interface. |
| 27 virtual void DidUpdateLayers(LayerTreeHost* host) OVERRIDE; | 27 virtual void DidUpdateLayers(LayerTreeHost* host) override; |
| 28 virtual void RunOnLayer(PictureLayer* layer) OVERRIDE; | 28 virtual void RunOnLayer(PictureLayer* layer) override; |
| 29 virtual bool ProcessMessage(scoped_ptr<base::Value> value) OVERRIDE; | 29 virtual bool ProcessMessage(scoped_ptr<base::Value> value) override; |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 enum Mode { FIXED_SIZE, LAYER, VIEWPORT, RANDOM }; | 32 enum Mode { FIXED_SIZE, LAYER, VIEWPORT, RANDOM }; |
| 33 | 33 |
| 34 void Run(Layer* layer); | 34 void Run(Layer* layer); |
| 35 float LCGRandom(); | 35 float LCGRandom(); |
| 36 | 36 |
| 37 Mode mode_; | 37 Mode mode_; |
| 38 int width_; | 38 int width_; |
| 39 int height_; | 39 int height_; |
| 40 uint32 seed_; | 40 uint32 seed_; |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace cc | 43 } // namespace cc |
| 44 | 44 |
| 45 #endif // CC_DEBUG_INVALIDATION_BENCHMARK_H_ | 45 #endif // CC_DEBUG_INVALIDATION_BENCHMARK_H_ |
| OLD | NEW |