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 SkScalar_DEFINED | 8 #ifndef SkScalar_DEFINED |
9 #define SkScalar_DEFINED | 9 #define SkScalar_DEFINED |
10 | 10 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 #define SkScalarATan2(y, x) atan2(y,x) | 94 #define SkScalarATan2(y, x) atan2(y,x) |
95 #define SkScalarExp(x) exp(x) | 95 #define SkScalarExp(x) exp(x) |
96 #define SkScalarLog(x) log(x) | 96 #define SkScalarLog(x) log(x) |
97 #define SkScalarLog2(x) log2(x) | 97 #define SkScalarLog2(x) log2(x) |
98 | 98 |
99 #endif | 99 #endif |
100 | 100 |
101 ////////////////////////////////////////////////////////////////////////////////
////////////////// | 101 ////////////////////////////////////////////////////////////////////////////////
////////////////// |
102 | 102 |
103 #define SkIntToScalar(x) static_cast<SkScalar>(x) | 103 #define SkIntToScalar(x) static_cast<SkScalar>(x) |
| 104 #define SkIntToFloat(x) static_cast<float>(x) |
104 #define SkScalarTruncToInt(x) static_cast<int>(x) | 105 #define SkScalarTruncToInt(x) static_cast<int>(x) |
105 | 106 |
106 #define SkScalarToFloat(x) static_cast<float>(x) | 107 #define SkScalarToFloat(x) static_cast<float>(x) |
107 #define SkFloatToScalar(x) static_cast<SkScalar>(x) | 108 #define SkFloatToScalar(x) static_cast<SkScalar>(x) |
108 #define SkScalarToDouble(x) static_cast<double>(x) | 109 #define SkScalarToDouble(x) static_cast<double>(x) |
109 #define SkDoubleToScalar(x) static_cast<SkScalar>(x) | 110 #define SkDoubleToScalar(x) static_cast<SkScalar>(x) |
110 | 111 |
111 #define SK_ScalarMin (-SK_ScalarMax) | 112 #define SK_ScalarMin (-SK_ScalarMax) |
112 | 113 |
113 static inline bool SkScalarIsNaN(SkScalar x) { return x != x; } | 114 static inline bool SkScalarIsNaN(SkScalar x) { return x != x; } |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 SkASSERT(n >= 0); | 259 SkASSERT(n >= 0); |
259 for (int i = 0; i < n; ++i) { | 260 for (int i = 0; i < n; ++i) { |
260 if (a[i] != b[i]) { | 261 if (a[i] != b[i]) { |
261 return false; | 262 return false; |
262 } | 263 } |
263 } | 264 } |
264 return true; | 265 return true; |
265 } | 266 } |
266 | 267 |
267 #endif | 268 #endif |
OLD | NEW |