| 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 #include "cc/debug/invalidation_benchmark.h" | 5 #include "cc/debug/invalidation_benchmark.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/rand_util.h" | 11 #include "base/rand_util.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/layers/layer.h" | 13 #include "cc/layers/layer.h" |
| 14 #include "cc/layers/picture_layer.h" | 14 #include "cc/layers/picture_layer.h" |
| 15 #include "cc/trees/layer_tree_host.h" | 15 #include "cc/trees/layer_tree_host.h" |
| 16 #include "cc/trees/layer_tree_host_common.h" | 16 #include "cc/trees/layer_tree_host_common.h" |
| 17 #include "ui/gfx/rect.h" | 17 #include "ui/gfx/geometry/rect.h" |
| 18 | 18 |
| 19 namespace cc { | 19 namespace cc { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 const char* kDefaultInvalidationMode = "viewport"; | 23 const char* kDefaultInvalidationMode = "viewport"; |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 InvalidationBenchmark::InvalidationBenchmark( | 27 InvalidationBenchmark::InvalidationBenchmark( |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // high quality, but they need to be identical in each run. Therefore, we use a | 130 // high quality, but they need to be identical in each run. Therefore, we use a |
| 131 // LCG and keep the state locally in the benchmark. | 131 // LCG and keep the state locally in the benchmark. |
| 132 float InvalidationBenchmark::LCGRandom() { | 132 float InvalidationBenchmark::LCGRandom() { |
| 133 const uint32 a = 1664525; | 133 const uint32 a = 1664525; |
| 134 const uint32 c = 1013904223; | 134 const uint32 c = 1013904223; |
| 135 seed_ = a * seed_ + c; | 135 seed_ = a * seed_ + c; |
| 136 return static_cast<float>(seed_) / std::numeric_limits<uint32>::max(); | 136 return static_cast<float>(seed_) / std::numeric_limits<uint32>::max(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 } // namespace cc | 139 } // namespace cc |
| OLD | NEW |