OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Android Open Source Project | 2 * Copyright 2008 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 #include "SkMathPriv.h" | 8 #include "SkMathPriv.h" |
9 #include "SkFixed.h" | 9 #include "SkFixed.h" |
10 #include "SkFloatBits.h" | 10 #include "SkFloatBits.h" |
11 #include "SkFloatingPoint.h" | 11 #include "SkFloatingPoint.h" |
12 #include "SkScalar.h" | 12 #include "SkScalar.h" |
13 | 13 |
14 const uint32_t gIEEENotANumber = 0x7FFFFFFF; | |
15 const uint32_t gIEEEInfinity = 0x7F800000; | |
16 const uint32_t gIEEENegativeInfinity = 0xFF800000; | |
17 | |
18 #define sub_shift(zeros, x, n) \ | 14 #define sub_shift(zeros, x, n) \ |
19 zeros -= n; \ | 15 zeros -= n; \ |
20 x >>= n | 16 x >>= n |
21 | 17 |
22 int SkCLZ_portable(uint32_t x) { | 18 int SkCLZ_portable(uint32_t x) { |
23 if (x == 0) { | 19 if (x == 0) { |
24 return 32; | 20 return 32; |
25 } | 21 } |
26 | 22 |
27 int zeros = 31; | 23 int zeros = 31; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 if (SkScalarNearlyZero(*cosValue)) { | 77 if (SkScalarNearlyZero(*cosValue)) { |
82 *cosValue = 0; | 78 *cosValue = 0; |
83 } | 79 } |
84 } | 80 } |
85 | 81 |
86 if (SkScalarNearlyZero(sinValue)) { | 82 if (SkScalarNearlyZero(sinValue)) { |
87 sinValue = 0; | 83 sinValue = 0; |
88 } | 84 } |
89 return sinValue; | 85 return sinValue; |
90 } | 86 } |
OLD | NEW |