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 SkFixed_DEFINED | 8 #ifndef SkFixed_DEFINED |
9 #define SkFixed_DEFINED | 9 #define SkFixed_DEFINED |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 #undef SkFloatToFixed | 133 #undef SkFloatToFixed |
134 #define SkFloatToFixed(x) SkFloatToFixed_arm(x) | 134 #define SkFloatToFixed(x) SkFloatToFixed_arm(x) |
135 #endif | 135 #endif |
136 | 136 |
137 #ifndef SkFixedMul | 137 #ifndef SkFixedMul |
138 #define SkFixedMul(x, y) SkFixedMul_portable(x, y) | 138 #define SkFixedMul(x, y) SkFixedMul_portable(x, y) |
139 #endif | 139 #endif |
140 | 140 |
141 /////////////////////////////////////////////////////////////////////////////// | 141 /////////////////////////////////////////////////////////////////////////////// |
142 | 142 |
143 typedef int64_t SkFixed48; | 143 typedef int64_t SkFixed3232; // 32.32 |
144 | 144 |
145 #define SkIntToFixed48(x) ((SkFixed48)(x) << 48) | 145 #define SkIntToFixed3232(x) ((SkFixed3232)(x) << 32) |
146 #define SkFixed48ToInt(x) ((int)((x) >> 48)) | 146 #define SkFixed3232ToInt(x) ((int)((x) >> 32)) |
147 #define SkFixedToFixed48(x) ((SkFixed48)(x) << 32) | 147 #define SkFixedToFixed3232(x) ((SkFixed3232)(x) << 16) |
148 #define SkFixed48ToFixed(x) ((SkFixed)((x) >> 32)) | 148 #define SkFixed3232ToFixed(x) ((SkFixed)((x) >> 16)) |
149 #define SkFloatToFixed48(x) ((SkFixed48)((x) * (65536.0f * 65536.0f * 65536.
0f))) | 149 #define SkFloatToFixed3232(x) ((SkFixed3232)((x) * (65536.0f * 65536.0f))) |
150 | 150 |
151 #define SkScalarToFixed48(x) SkFloatToFixed48(x) | 151 #define SkScalarToFixed3232(x) SkFloatToFixed3232(x) |
152 | 152 |
153 #endif | 153 #endif |
OLD | NEW |