epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 1 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 2 | /* |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 3 | * Copyright 2006 The Android Open Source Project |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 4 | * |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 7 | */ |
| 8 | |
epoger@google.com | ec3ed6a | 2011-07-28 14:26:00 +0000 | [diff] [blame] | 9 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 10 | #ifndef SkRandom_DEFINED |
| 11 | #define SkRandom_DEFINED |
| 12 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 13 | #include "SkScalar.h" |
| 14 | |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 15 | #ifdef SK_SUPPORT_LEGACY_SK64 |
| 16 | #include "Sk64.h" |
| 17 | #endif |
| 18 | |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 19 | /** \class SkLCGRandom |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 20 | |
| 21 | Utility class that implements pseudo random 32bit numbers using a fast |
| 22 | linear equation. Unlike rand(), this class holds its own seed (initially |
| 23 | set to 0), so that multiple instances can be used with no side-effects. |
| 24 | */ |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 25 | class SkLCGRandom { |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 26 | public: |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 27 | SkLCGRandom() : fSeed(0) {} |
| 28 | SkLCGRandom(uint32_t seed) : fSeed(seed) {} |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 29 | |
| 30 | /** Return the next pseudo random number as an unsigned 32bit value. |
| 31 | */ |
| 32 | uint32_t nextU() { uint32_t r = fSeed * kMul + kAdd; fSeed = r; return r; } |
| 33 | |
| 34 | /** Return the next pseudo random number as a signed 32bit value. |
| 35 | */ |
| 36 | int32_t nextS() { return (int32_t)this->nextU(); } |
| 37 | |
| 38 | /** Return the next pseudo random number as an unsigned 16bit value. |
| 39 | */ |
| 40 | U16CPU nextU16() { return this->nextU() >> 16; } |
| 41 | |
| 42 | /** Return the next pseudo random number as a signed 16bit value. |
| 43 | */ |
| 44 | S16CPU nextS16() { return this->nextS() >> 16; } |
| 45 | |
tfarina@chromium.org | 223137f | 2012-11-21 22:38:36 +0000 | [diff] [blame] | 46 | /** |
| 47 | * Returns value [0...1) as a float |
| 48 | */ |
| 49 | float nextF() { |
| 50 | // const is 1 / (2^32 - 1) |
| 51 | return (float)(this->nextU() * 2.32830644e-10); |
| 52 | } |
| 53 | |
| 54 | /** |
| 55 | * Returns value [min...max) as a float |
| 56 | */ |
| 57 | float nextRangeF(float min, float max) { |
| 58 | return min + this->nextF() * (max - min); |
| 59 | } |
| 60 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 61 | /** Return the next pseudo random number, as an unsigned value of |
| 62 | at most bitCount bits. |
| 63 | @param bitCount The maximum number of bits to be returned |
| 64 | */ |
| 65 | uint32_t nextBits(unsigned bitCount) { |
| 66 | SkASSERT(bitCount > 0 && bitCount <= 32); |
| 67 | return this->nextU() >> (32 - bitCount); |
| 68 | } |
| 69 | |
| 70 | /** Return the next pseudo random unsigned number, mapped to lie within |
| 71 | [min, max] inclusive. |
| 72 | */ |
| 73 | uint32_t nextRangeU(uint32_t min, uint32_t max) { |
| 74 | SkASSERT(min <= max); |
bsalomon@google.com | 6d5d08f | 2013-01-25 19:19:20 +0000 | [diff] [blame] | 75 | uint32_t range = max - min + 1; |
| 76 | if (0 == range) { |
| 77 | return this->nextU(); |
| 78 | } else { |
| 79 | return min + this->nextU() % range; |
| 80 | } |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 81 | } |
| 82 | |
bsalomon@google.com | d472620 | 2012-08-03 14:34:46 +0000 | [diff] [blame] | 83 | /** Return the next pseudo random unsigned number, mapped to lie within |
| 84 | [0, count). |
| 85 | */ |
| 86 | uint32_t nextULessThan(uint32_t count) { |
| 87 | SkASSERT(count > 0); |
| 88 | return this->nextRangeU(0, count - 1); |
| 89 | } |
| 90 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 91 | /** Return the next pseudo random number expressed as an unsigned SkFixed |
| 92 | in the range [0..SK_Fixed1). |
| 93 | */ |
| 94 | SkFixed nextUFixed1() { return this->nextU() >> 16; } |
| 95 | |
| 96 | /** Return the next pseudo random number expressed as a signed SkFixed |
| 97 | in the range (-SK_Fixed1..SK_Fixed1). |
| 98 | */ |
| 99 | SkFixed nextSFixed1() { return this->nextS() >> 15; } |
| 100 | |
| 101 | /** Return the next pseudo random number expressed as a SkScalar |
| 102 | in the range [0..SK_Scalar1). |
| 103 | */ |
| 104 | SkScalar nextUScalar1() { return SkFixedToScalar(this->nextUFixed1()); } |
| 105 | |
| 106 | /** Return the next pseudo random number expressed as a SkScalar |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 107 | in the range [min..max). |
| 108 | */ |
| 109 | SkScalar nextRangeScalar(SkScalar min, SkScalar max) { |
bsalomon@google.com | 7b7cdd1 | 2012-11-07 16:17:24 +0000 | [diff] [blame] | 110 | return SkScalarMul(this->nextUScalar1(), (max - min)) + min; |
bsalomon@google.com | 0a7672f | 2012-08-03 18:12:20 +0000 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | /** Return the next pseudo random number expressed as a SkScalar |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 114 | in the range (-SK_Scalar1..SK_Scalar1). |
| 115 | */ |
| 116 | SkScalar nextSScalar1() { return SkFixedToScalar(this->nextSFixed1()); } |
| 117 | |
bsalomon@google.com | d472620 | 2012-08-03 14:34:46 +0000 | [diff] [blame] | 118 | /** Return the next pseudo random number as a bool. |
| 119 | */ |
| 120 | bool nextBool() { return this->nextU() >= 0x80000000; } |
| 121 | |
bsalomon@google.com | 705e840 | 2012-11-27 15:43:57 +0000 | [diff] [blame] | 122 | /** A biased version of nextBool(). |
| 123 | */ |
| 124 | bool nextBiasedBool(SkScalar fractionTrue) { |
| 125 | SkASSERT(fractionTrue >= 0 && fractionTrue <= SK_Scalar1); |
| 126 | return this->nextUScalar1() <= fractionTrue; |
| 127 | } |
| 128 | |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 129 | /** |
| 130 | * Return the next pseudo random number as a signed 64bit value. |
| 131 | */ |
| 132 | int64_t next64() { |
| 133 | int64_t hi = this->nextS(); |
| 134 | return (hi << 32) | this->nextU(); |
| 135 | } |
| 136 | |
| 137 | #ifdef SK_SUPPORT_LEGACY_SK64 |
| 138 | SK_ATTR_DEPRECATED("use next64()") |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 139 | void next64(Sk64* a) { |
| 140 | SkASSERT(a); |
| 141 | a->set(this->nextS(), this->nextU()); |
| 142 | } |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 143 | #endif |
reed@google.com | 425a8c7 | 2012-10-02 17:51:29 +0000 | [diff] [blame] | 144 | /** |
| 145 | * Return the current seed. This allows the caller to later reset to the |
| 146 | * same seed (using setSeed) so it can generate the same sequence. |
| 147 | */ |
| 148 | int32_t getSeed() const { return fSeed; } |
| 149 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 150 | /** Set the seed of the random object. The seed is initialized to 0 when the |
| 151 | object is first created, and is updated each time the next pseudo random |
| 152 | number is requested. |
| 153 | */ |
| 154 | void setSeed(int32_t seed) { fSeed = (uint32_t)seed; } |
| 155 | |
| 156 | private: |
| 157 | // See "Numerical Recipes in C", 1992 page 284 for these constants |
| 158 | enum { |
| 159 | kMul = 1664525, |
| 160 | kAdd = 1013904223 |
| 161 | }; |
| 162 | uint32_t fSeed; |
| 163 | }; |
| 164 | |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 165 | /** \class SkRandom |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 166 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 167 | Utility class that implements pseudo random 32bit numbers using Marsaglia's |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 168 | multiply-with-carry "mother of all" algorithm. Unlike rand(), this class holds |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 169 | its own state, so that multiple instances can be used with no side-effects. |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 170 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 171 | Has a large period and all bits are well-randomized. |
| 172 | */ |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 173 | class SkRandom { |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 174 | public: |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 175 | SkRandom() { init(0); } |
| 176 | SkRandom(uint32_t seed) { init(seed); } |
| 177 | SkRandom(const SkRandom& rand) : fK(rand.fK), fJ(rand.fJ) {} |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 178 | |
commit-bot@chromium.org | e0e7cfe | 2013-09-09 20:09:12 +0000 | [diff] [blame] | 179 | SkRandom& operator=(const SkRandom& rand) { |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 180 | fK = rand.fK; |
| 181 | fJ = rand.fJ; |
| 182 | |
| 183 | return *this; |
| 184 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 185 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 186 | /** Return the next pseudo random number as an unsigned 32bit value. |
| 187 | */ |
| 188 | uint32_t nextU() { |
| 189 | fK = kKMul*(fK & 0xffff) + (fK >> 16); |
| 190 | fJ = kJMul*(fJ & 0xffff) + (fJ >> 16); |
| 191 | return (((fK << 16) | (fK >> 16)) + fJ); |
| 192 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 193 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 194 | /** Return the next pseudo random number as a signed 32bit value. |
| 195 | */ |
| 196 | int32_t nextS() { return (int32_t)this->nextU(); } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 197 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 198 | /** Return the next pseudo random number as an unsigned 16bit value. |
| 199 | */ |
| 200 | U16CPU nextU16() { return this->nextU() >> 16; } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 201 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 202 | /** Return the next pseudo random number as a signed 16bit value. |
| 203 | */ |
| 204 | S16CPU nextS16() { return this->nextS() >> 16; } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 205 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 206 | /** |
| 207 | * Returns value [0...1) as an IEEE float |
| 208 | */ |
| 209 | float nextF() { |
| 210 | unsigned int floatint = 0x3f800000 | (this->nextU() >> 9); |
bsalomon@google.com | 753a362 | 2013-02-07 19:52:30 +0000 | [diff] [blame] | 211 | float f = SkBits2Float(floatint) - 1.0f; |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 212 | return f; |
| 213 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 214 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 215 | /** |
| 216 | * Returns value [min...max) as a float |
| 217 | */ |
| 218 | float nextRangeF(float min, float max) { |
| 219 | return min + this->nextF() * (max - min); |
| 220 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 221 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 222 | /** Return the next pseudo random number, as an unsigned value of |
| 223 | at most bitCount bits. |
| 224 | @param bitCount The maximum number of bits to be returned |
| 225 | */ |
| 226 | uint32_t nextBits(unsigned bitCount) { |
| 227 | SkASSERT(bitCount > 0 && bitCount <= 32); |
| 228 | return this->nextU() >> (32 - bitCount); |
| 229 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 230 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 231 | /** Return the next pseudo random unsigned number, mapped to lie within |
| 232 | [min, max] inclusive. |
| 233 | */ |
| 234 | uint32_t nextRangeU(uint32_t min, uint32_t max) { |
| 235 | SkASSERT(min <= max); |
| 236 | uint32_t range = max - min + 1; |
| 237 | if (0 == range) { |
| 238 | return this->nextU(); |
| 239 | } else { |
| 240 | return min + this->nextU() % range; |
| 241 | } |
| 242 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 243 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 244 | /** Return the next pseudo random unsigned number, mapped to lie within |
| 245 | [0, count). |
| 246 | */ |
| 247 | uint32_t nextULessThan(uint32_t count) { |
| 248 | SkASSERT(count > 0); |
| 249 | return this->nextRangeU(0, count - 1); |
| 250 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 251 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 252 | /** Return the next pseudo random number expressed as an unsigned SkFixed |
| 253 | in the range [0..SK_Fixed1). |
| 254 | */ |
| 255 | SkFixed nextUFixed1() { return this->nextU() >> 16; } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 256 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 257 | /** Return the next pseudo random number expressed as a signed SkFixed |
| 258 | in the range (-SK_Fixed1..SK_Fixed1). |
| 259 | */ |
| 260 | SkFixed nextSFixed1() { return this->nextS() >> 15; } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 261 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 262 | /** Return the next pseudo random number expressed as a SkScalar |
| 263 | in the range [0..SK_Scalar1). |
| 264 | */ |
| 265 | SkScalar nextUScalar1() { return SkFixedToScalar(this->nextUFixed1()); } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 266 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 267 | /** Return the next pseudo random number expressed as a SkScalar |
| 268 | in the range [min..max). |
| 269 | */ |
| 270 | SkScalar nextRangeScalar(SkScalar min, SkScalar max) { |
| 271 | return SkScalarMul(this->nextUScalar1(), (max - min)) + min; |
| 272 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 273 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 274 | /** Return the next pseudo random number expressed as a SkScalar |
| 275 | in the range (-SK_Scalar1..SK_Scalar1). |
| 276 | */ |
| 277 | SkScalar nextSScalar1() { return SkFixedToScalar(this->nextSFixed1()); } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 278 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 279 | /** Return the next pseudo random number as a bool. |
| 280 | */ |
| 281 | bool nextBool() { return this->nextU() >= 0x80000000; } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 282 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 283 | /** A biased version of nextBool(). |
| 284 | */ |
| 285 | bool nextBiasedBool(SkScalar fractionTrue) { |
| 286 | SkASSERT(fractionTrue >= 0 && fractionTrue <= SK_Scalar1); |
| 287 | return this->nextUScalar1() <= fractionTrue; |
| 288 | } |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 289 | |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 290 | /** |
| 291 | * Return the next pseudo random number as a signed 64bit value. |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 292 | */ |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 293 | int64_t next64() { |
| 294 | int64_t hi = this->nextS(); |
| 295 | return (hi << 32) | this->nextU(); |
| 296 | } |
skia.committer@gmail.com | f5e1f63 | 2013-12-31 07:01:36 +0000 | [diff] [blame^] | 297 | |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 298 | #ifdef SK_SUPPORT_LEGACY_SK64 |
| 299 | SK_ATTR_DEPRECATED("use next64()") |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 300 | void next64(Sk64* a) { |
| 301 | SkASSERT(a); |
| 302 | a->set(this->nextS(), this->nextU()); |
| 303 | } |
reed@google.com | 57212f9 | 2013-12-30 14:40:38 +0000 | [diff] [blame] | 304 | #endif |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 305 | |
| 306 | /** Reset the random object. |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 307 | */ |
| 308 | void setSeed(uint32_t seed) { init(seed); } |
| 309 | |
| 310 | private: |
| 311 | // Initialize state variables with LCG. |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 312 | // We must ensure that both J and K are non-zero, otherwise the |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 313 | // multiply-with-carry step will forevermore return zero. |
| 314 | void init(uint32_t seed) { |
| 315 | fK = NextLCG(seed); |
| 316 | if (0 == fK) { |
| 317 | fK = NextLCG(fK); |
| 318 | } |
| 319 | fJ = NextLCG(fK); |
| 320 | if (0 == fJ) { |
| 321 | fJ = NextLCG(fJ); |
| 322 | } |
| 323 | SkASSERT(0 != fK && 0 != fJ); |
| 324 | } |
| 325 | static uint32_t NextLCG(uint32_t seed) { return kMul*seed + kAdd; } |
| 326 | |
| 327 | // See "Numerical Recipes in C", 1992 page 284 for these constants |
| 328 | // For the LCG that sets the initial state from a seed |
| 329 | enum { |
| 330 | kMul = 1664525, |
| 331 | kAdd = 1013904223 |
| 332 | }; |
| 333 | // Constants for the multiply-with-carry steps |
| 334 | enum { |
| 335 | kKMul = 30345, |
| 336 | kJMul = 18000, |
| 337 | }; |
skia.committer@gmail.com | 24d5ee4 | 2013-01-31 07:06:15 +0000 | [diff] [blame] | 338 | |
jvanverth@google.com | a8e66f7 | 2013-01-30 15:42:19 +0000 | [diff] [blame] | 339 | uint32_t fK; |
| 340 | uint32_t fJ; |
| 341 | }; |
| 342 | |
reed@android.com | 8a1c16f | 2008-12-17 15:59:43 +0000 | [diff] [blame] | 343 | #endif |