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