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