OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkRandom_DEFINED | 8 #ifndef SkRandom_DEFINED |
9 #define SkRandom_DEFINED | 9 #define SkRandom_DEFINED |
10 | 10 |
| 11 #include "../private/SkFixed.h" |
11 #include "SkScalar.h" | 12 #include "SkScalar.h" |
12 | 13 |
13 /** \class SkRandom | 14 /** \class SkRandom |
14 | 15 |
15 Utility class that implements pseudo random 32bit numbers using Marsaglia's | 16 Utility class that implements pseudo random 32bit numbers using Marsaglia's |
16 multiply-with-carry "mother of all" algorithm. Unlike rand(), this class holds | 17 multiply-with-carry "mother of all" algorithm. Unlike rand(), this class holds |
17 its own state, so that multiple instances can be used with no side-effects. | 18 its own state, so that multiple instances can be used with no side-effects. |
18 | 19 |
19 Has a large period and all bits are well-randomized. | 20 Has a large period and all bits are well-randomized. |
20 */ | 21 */ |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 enum { | 175 enum { |
175 kKMul = 30345, | 176 kKMul = 30345, |
176 kJMul = 18000, | 177 kJMul = 18000, |
177 }; | 178 }; |
178 | 179 |
179 uint32_t fK; | 180 uint32_t fK; |
180 uint32_t fJ; | 181 uint32_t fJ; |
181 }; | 182 }; |
182 | 183 |
183 #endif | 184 #endif |
OLD | NEW |