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 <stdint.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <limits> | 10 #include <limits> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/rand_util.h" | 12 #include "base/rand_util.h" |
12 #include "base/values.h" | 13 #include "base/values.h" |
13 #include "cc/layers/layer.h" | 14 #include "cc/layers/layer.h" |
14 #include "cc/layers/picture_layer.h" | 15 #include "cc/layers/picture_layer.h" |
15 #include "cc/trees/layer_tree_host.h" | 16 #include "cc/trees/layer_tree_host.h" |
16 #include "cc/trees/layer_tree_host_common.h" | 17 #include "cc/trees/layer_tree_host_common.h" |
17 #include "ui/gfx/geometry/rect.h" | 18 #include "ui/gfx/geometry/rect.h" |
18 | 19 |
19 namespace cc { | 20 namespace cc { |
20 | 21 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 NotifyDone(base::Value::CreateNullValue()); | 120 NotifyDone(base::Value::CreateNullValue()); |
120 return true; | 121 return true; |
121 } | 122 } |
122 return false; | 123 return false; |
123 } | 124 } |
124 | 125 |
125 // A simple linear congruential generator. The random numbers don't need to be | 126 // A simple linear congruential generator. The random numbers don't need to be |
126 // high quality, but they need to be identical in each run. Therefore, we use a | 127 // high quality, but they need to be identical in each run. Therefore, we use a |
127 // LCG and keep the state locally in the benchmark. | 128 // LCG and keep the state locally in the benchmark. |
128 float InvalidationBenchmark::LCGRandom() { | 129 float InvalidationBenchmark::LCGRandom() { |
129 const uint32 a = 1664525; | 130 const uint32_t a = 1664525; |
130 const uint32 c = 1013904223; | 131 const uint32_t c = 1013904223; |
131 seed_ = a * seed_ + c; | 132 seed_ = a * seed_ + c; |
132 return static_cast<float>(seed_) / std::numeric_limits<uint32>::max(); | 133 return static_cast<float>(seed_) / std::numeric_limits<uint32_t>::max(); |
133 } | 134 } |
134 | 135 |
135 } // namespace cc | 136 } // namespace cc |
OLD | NEW |