Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Side by Side Diff: cc/debug/invalidation_benchmark.cc

Issue 1539203002: Switch to standard integer types in cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/debug/invalidation_benchmark.h ('k') | cc/debug/lap_timer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « cc/debug/invalidation_benchmark.h ('k') | cc/debug/lap_timer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698