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 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 #define SkAlign2(x) (((x) + 1) >> 1 << 1) | 294 #define SkAlign2(x) (((x) + 1) >> 1 << 1) |
295 #define SkIsAlign2(x) (0 == ((x) & 1)) | 295 #define SkIsAlign2(x) (0 == ((x) & 1)) |
296 | 296 |
297 #define SkAlign4(x) (((x) + 3) >> 2 << 2) | 297 #define SkAlign4(x) (((x) + 3) >> 2 << 2) |
298 #define SkIsAlign4(x) (0 == ((x) & 3)) | 298 #define SkIsAlign4(x) (0 == ((x) & 3)) |
299 | 299 |
300 #define SkAlign8(x) (((x) + 7) >> 3 << 3) | 300 #define SkAlign8(x) (((x) + 7) >> 3 << 3) |
301 #define SkIsAlign8(x) (0 == ((x) & 7)) | 301 #define SkIsAlign8(x) (0 == ((x) & 7)) |
302 | 302 |
| 303 #define SkAlign16(x) (((x) + 15) >> 4 << 4) |
| 304 #define SkIsAlign16(x) (0 == ((x) & 15)) |
| 305 |
303 #define SkAlignPtr(x) (sizeof(void*) == 8 ? SkAlign8(x) : SkAlign4(x)) | 306 #define SkAlignPtr(x) (sizeof(void*) == 8 ? SkAlign8(x) : SkAlign4(x)) |
304 #define SkIsAlignPtr(x) (sizeof(void*) == 8 ? SkIsAlign8(x) : SkIsAlign4(x)) | 307 #define SkIsAlignPtr(x) (sizeof(void*) == 8 ? SkIsAlign8(x) : SkIsAlign4(x)) |
305 | 308 |
306 typedef uint32_t SkFourByteTag; | 309 typedef uint32_t SkFourByteTag; |
307 #define SkSetFourByteTag(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8)
| (d)) | 310 #define SkSetFourByteTag(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8)
| (d)) |
308 | 311 |
309 /** 32 bit integer to hold a unicode value | 312 /** 32 bit integer to hold a unicode value |
310 */ | 313 */ |
311 typedef int32_t SkUnichar; | 314 typedef int32_t SkUnichar; |
312 /** 32 bit value to hold a millisecond count | 315 /** 32 bit value to hold a millisecond count |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 private: | 671 private: |
669 void* fPtr; | 672 void* fPtr; |
670 size_t fSize; // can be larger than the requested size (see kReuse) | 673 size_t fSize; // can be larger than the requested size (see kReuse) |
671 uint32_t fStorage[(kSize + 3) >> 2]; | 674 uint32_t fStorage[(kSize + 3) >> 2]; |
672 }; | 675 }; |
673 // Can't guard the constructor because it's a template class. | 676 // Can't guard the constructor because it's a template class. |
674 | 677 |
675 #endif /* C++ */ | 678 #endif /* C++ */ |
676 | 679 |
677 #endif | 680 #endif |
OLD | NEW |