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 SkFixed_DEFINED | 10 #ifndef SkFixed_DEFINED |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 /////////////////////////////////////////////////////////////////////////////// | 275 /////////////////////////////////////////////////////////////////////////////// |
276 | 276 |
277 typedef int64_t SkFixed48; | 277 typedef int64_t SkFixed48; |
278 | 278 |
279 #define SkIntToFixed48(x) ((SkFixed48)(x) << 48) | 279 #define SkIntToFixed48(x) ((SkFixed48)(x) << 48) |
280 #define SkFixed48ToInt(x) ((int)((x) >> 48)) | 280 #define SkFixed48ToInt(x) ((int)((x) >> 48)) |
281 #define SkFixedToFixed48(x) ((SkFixed48)(x) << 32) | 281 #define SkFixedToFixed48(x) ((SkFixed48)(x) << 32) |
282 #define SkFixed48ToFixed(x) ((SkFixed)((x) >> 32)) | 282 #define SkFixed48ToFixed(x) ((SkFixed)((x) >> 32)) |
283 #define SkFloatToFixed48(x) ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536.
0f))) | 283 #define SkFloatToFixed48(x) ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536.
0f))) |
284 | 284 |
285 #ifdef SK_SCALAR_IS_FLOAT | 285 #define SkScalarToFixed48(x) SkFloatToFixed48(x) |
286 #define SkScalarToFixed48(x) SkFloatToFixed48(x) | |
287 #else | |
288 #define SkScalarToFixed48(x) SkFixedToFixed48(x) | |
289 #endif | |
290 | 286 |
291 #endif | 287 #endif |
OLD | NEW |