Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 #ifndef SkMath_DEFINED | 10 #ifndef SkMath_DEFINED |
| 11 #define SkMath_DEFINED | 11 #define SkMath_DEFINED |
| 12 | 12 |
| 13 #include "SkTypes.h" | 13 #include "SkTypes.h" |
| 14 | 14 |
| 15 /////////////////////////////////////////////////////////////////////////////// | |
| 16 | |
| 17 enum { kMask_00FF00FF = 0xFF00FF }; | |
|
reed1
2014/05/12 14:48:07
I think we should just use 0xFF00FF where the site
pasko
2014/05/12 15:06:19
I agree. Done. Also removed one commented-out left
| |
| 18 | |
| 19 /////////////////////////////////////////////////////////////////////////////// | |
| 20 | |
| 15 // 64bit -> 32bit utilities | 21 // 64bit -> 32bit utilities |
| 16 | 22 |
| 17 /** | 23 /** |
| 18 * Return true iff the 64bit value can exactly be represented in signed 32bits | 24 * Return true iff the 64bit value can exactly be represented in signed 32bits |
| 19 */ | 25 */ |
| 20 static inline bool sk_64_isS32(int64_t value) { | 26 static inline bool sk_64_isS32(int64_t value) { |
| 21 return (int32_t)value == value; | 27 return (int32_t)value == value; |
| 22 } | 28 } |
| 23 | 29 |
| 24 /** | 30 /** |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 220 *div = static_cast<Out>(d); | 226 *div = static_cast<Out>(d); |
| 221 *mod = static_cast<Out>(numer-d*denom); | 227 *mod = static_cast<Out>(numer-d*denom); |
| 222 #else | 228 #else |
| 223 // On x86 this will just be a single idiv. | 229 // On x86 this will just be a single idiv. |
| 224 *div = static_cast<Out>(numer/denom); | 230 *div = static_cast<Out>(numer/denom); |
| 225 *mod = static_cast<Out>(numer%denom); | 231 *mod = static_cast<Out>(numer%denom); |
| 226 #endif // SK_CPU_ARM | 232 #endif // SK_CPU_ARM |
| 227 } | 233 } |
| 228 | 234 |
| 229 #endif | 235 #endif |
| OLD | NEW |