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 SkTypes_DEFINED | 8 #ifndef SkTypes_DEFINED |
9 #define SkTypes_DEFINED | 9 #define SkTypes_DEFINED |
10 | 10 |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 212 |
213 #ifdef SK_DEBUG | 213 #ifdef SK_DEBUG |
214 SK_API int8_t SkToS8(intmax_t); | 214 SK_API int8_t SkToS8(intmax_t); |
215 SK_API uint8_t SkToU8(uintmax_t); | 215 SK_API uint8_t SkToU8(uintmax_t); |
216 SK_API int16_t SkToS16(intmax_t); | 216 SK_API int16_t SkToS16(intmax_t); |
217 SK_API uint16_t SkToU16(uintmax_t); | 217 SK_API uint16_t SkToU16(uintmax_t); |
218 SK_API int32_t SkToS32(intmax_t); | 218 SK_API int32_t SkToS32(intmax_t); |
219 SK_API uint32_t SkToU32(uintmax_t); | 219 SK_API uint32_t SkToU32(uintmax_t); |
220 SK_API int SkToInt(intmax_t); | 220 SK_API int SkToInt(intmax_t); |
221 SK_API unsigned SkToUInt(uintmax_t); | 221 SK_API unsigned SkToUInt(uintmax_t); |
| 222 SK_API size_t SkToSizeT(uintmax_t); |
222 #else | 223 #else |
223 #define SkToS8(x) ((int8_t)(x)) | 224 #define SkToS8(x) ((int8_t)(x)) |
224 #define SkToU8(x) ((uint8_t)(x)) | 225 #define SkToU8(x) ((uint8_t)(x)) |
225 #define SkToS16(x) ((int16_t)(x)) | 226 #define SkToS16(x) ((int16_t)(x)) |
226 #define SkToU16(x) ((uint16_t)(x)) | 227 #define SkToU16(x) ((uint16_t)(x)) |
227 #define SkToS32(x) ((int32_t)(x)) | 228 #define SkToS32(x) ((int32_t)(x)) |
228 #define SkToU32(x) ((uint32_t)(x)) | 229 #define SkToU32(x) ((uint32_t)(x)) |
229 #define SkToInt(x) ((int)(x)) | 230 #define SkToInt(x) ((int)(x)) |
230 #define SkToUInt(x) ((unsigned)(x)) | 231 #define SkToUInt(x) ((unsigned)(x)) |
| 232 #define SkToSizeT(x) ((size_t)(x)) |
231 #endif | 233 #endif |
232 | 234 |
233 /** Returns 0 or 1 based on the condition | 235 /** Returns 0 or 1 based on the condition |
234 */ | 236 */ |
235 #define SkToBool(cond) ((cond) != 0) | 237 #define SkToBool(cond) ((cond) != 0) |
236 | 238 |
237 #define SK_MaxS16 32767 | 239 #define SK_MaxS16 32767 |
238 #define SK_MinS16 -32767 | 240 #define SK_MinS16 -32767 |
239 #define SK_MaxU16 0xFFFF | 241 #define SK_MaxU16 0xFFFF |
240 #define SK_MinU16 0 | 242 #define SK_MinU16 0 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 private: | 634 private: |
633 void* fPtr; | 635 void* fPtr; |
634 size_t fSize; // can be larger than the requested size (see kReuse) | 636 size_t fSize; // can be larger than the requested size (see kReuse) |
635 uint32_t fStorage[(kSize + 3) >> 2]; | 637 uint32_t fStorage[(kSize + 3) >> 2]; |
636 }; | 638 }; |
637 // Can't guard the constructor because it's a template class. | 639 // Can't guard the constructor because it's a template class. |
638 | 640 |
639 #endif /* C++ */ | 641 #endif /* C++ */ |
640 | 642 |
641 #endif | 643 #endif |
OLD | NEW |