| 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 |
| 11 #include "SkPreConfig.h" | 11 #include "SkPreConfig.h" |
| 12 #include "SkUserConfig.h" | 12 #include "SkUserConfig.h" |
| 13 #include "SkPostConfig.h" | 13 #include "SkPostConfig.h" |
| 14 #include <stdint.h> | 14 #include <stdint.h> |
| 15 #include <sys/types.h> |
| 15 | 16 |
| 16 /** \file SkTypes.h | 17 /** \file SkTypes.h |
| 17 */ | 18 */ |
| 18 | 19 |
| 19 /** See SkGraphics::GetVersion() to retrieve these at runtime | 20 /** See SkGraphics::GetVersion() to retrieve these at runtime |
| 20 */ | 21 */ |
| 21 #define SKIA_VERSION_MAJOR 1 | 22 #define SKIA_VERSION_MAJOR 1 |
| 22 #define SKIA_VERSION_MINOR 0 | 23 #define SKIA_VERSION_MINOR 0 |
| 23 #define SKIA_VERSION_PATCH 0 | 24 #define SKIA_VERSION_PATCH 0 |
| 24 | 25 |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 #ifdef SK_DEBUG | 238 #ifdef SK_DEBUG |
| 238 SK_API int8_t SkToS8(intmax_t); | 239 SK_API int8_t SkToS8(intmax_t); |
| 239 SK_API uint8_t SkToU8(uintmax_t); | 240 SK_API uint8_t SkToU8(uintmax_t); |
| 240 SK_API int16_t SkToS16(intmax_t); | 241 SK_API int16_t SkToS16(intmax_t); |
| 241 SK_API uint16_t SkToU16(uintmax_t); | 242 SK_API uint16_t SkToU16(uintmax_t); |
| 242 SK_API int32_t SkToS32(intmax_t); | 243 SK_API int32_t SkToS32(intmax_t); |
| 243 SK_API uint32_t SkToU32(uintmax_t); | 244 SK_API uint32_t SkToU32(uintmax_t); |
| 244 SK_API int SkToInt(intmax_t); | 245 SK_API int SkToInt(intmax_t); |
| 245 SK_API unsigned SkToUInt(uintmax_t); | 246 SK_API unsigned SkToUInt(uintmax_t); |
| 246 SK_API size_t SkToSizeT(uintmax_t); | 247 SK_API size_t SkToSizeT(uintmax_t); |
| 248 SK_API off_t SkToOffT(intmax_t x); |
| 247 #else | 249 #else |
| 248 #define SkToS8(x) ((int8_t)(x)) | 250 #define SkToS8(x) ((int8_t)(x)) |
| 249 #define SkToU8(x) ((uint8_t)(x)) | 251 #define SkToU8(x) ((uint8_t)(x)) |
| 250 #define SkToS16(x) ((int16_t)(x)) | 252 #define SkToS16(x) ((int16_t)(x)) |
| 251 #define SkToU16(x) ((uint16_t)(x)) | 253 #define SkToU16(x) ((uint16_t)(x)) |
| 252 #define SkToS32(x) ((int32_t)(x)) | 254 #define SkToS32(x) ((int32_t)(x)) |
| 253 #define SkToU32(x) ((uint32_t)(x)) | 255 #define SkToU32(x) ((uint32_t)(x)) |
| 254 #define SkToInt(x) ((int)(x)) | 256 #define SkToInt(x) ((int)(x)) |
| 255 #define SkToUInt(x) ((unsigned)(x)) | 257 #define SkToUInt(x) ((unsigned)(x)) |
| 256 #define SkToSizeT(x) ((size_t)(x)) | 258 #define SkToSizeT(x) ((size_t)(x)) |
| 259 #define SkToOffT(x) ((off_t)(x)) |
| 257 #endif | 260 #endif |
| 258 | 261 |
| 259 /** Returns 0 or 1 based on the condition | 262 /** Returns 0 or 1 based on the condition |
| 260 */ | 263 */ |
| 261 #define SkToBool(cond) ((cond) != 0) | 264 #define SkToBool(cond) ((cond) != 0) |
| 262 | 265 |
| 263 #define SK_MaxS16 32767 | 266 #define SK_MaxS16 32767 |
| 264 #define SK_MinS16 -32767 | 267 #define SK_MinS16 -32767 |
| 265 #define SK_MaxU16 0xFFFF | 268 #define SK_MaxU16 0xFFFF |
| 266 #define SK_MinU16 0 | 269 #define SK_MinU16 0 |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 private: | 672 private: |
| 670 void* fPtr; | 673 void* fPtr; |
| 671 size_t fSize; // can be larger than the requested size (see kReuse) | 674 size_t fSize; // can be larger than the requested size (see kReuse) |
| 672 uint32_t fStorage[(kSize + 3) >> 2]; | 675 uint32_t fStorage[(kSize + 3) >> 2]; |
| 673 }; | 676 }; |
| 674 // Can't guard the constructor because it's a template class. | 677 // Can't guard the constructor because it's a template class. |
| 675 | 678 |
| 676 #endif /* C++ */ | 679 #endif /* C++ */ |
| 677 | 680 |
| 678 #endif | 681 #endif |
| OLD | NEW |