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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 /** maximum representable milliseconds | 308 /** maximum representable milliseconds |
309 */ | 309 */ |
310 #define SK_MSecMax 0x7FFFFFFF | 310 #define SK_MSecMax 0x7FFFFFFF |
311 /** Returns a < b for milliseconds, correctly handling wrap-around from 0xFFFFFF
FF to 0 | 311 /** Returns a < b for milliseconds, correctly handling wrap-around from 0xFFFFFF
FF to 0 |
312 */ | 312 */ |
313 #define SkMSec_LT(a, b) ((int32_t)(a) - (int32_t)(b) < 0) | 313 #define SkMSec_LT(a, b) ((int32_t)(a) - (int32_t)(b) < 0) |
314 /** Returns a <= b for milliseconds, correctly handling wrap-around from 0xFFFFF
FFF to 0 | 314 /** Returns a <= b for milliseconds, correctly handling wrap-around from 0xFFFFF
FFF to 0 |
315 */ | 315 */ |
316 #define SkMSec_LE(a, b) ((int32_t)(a) - (int32_t)(b) <= 0) | 316 #define SkMSec_LE(a, b) ((int32_t)(a) - (int32_t)(b) <= 0) |
317 | 317 |
| 318 /** The generation IDs in Skia reserve 0 has an invalid marker. |
| 319 */ |
| 320 #define SK_InvalidGenID 0 |
| 321 |
318 /**************************************************************************** | 322 /**************************************************************************** |
319 The rest of these only build with C++ | 323 The rest of these only build with C++ |
320 */ | 324 */ |
321 #ifdef __cplusplus | 325 #ifdef __cplusplus |
322 | 326 |
323 /** Faster than SkToBool for integral conditions. Returns 0 or 1 | 327 /** Faster than SkToBool for integral conditions. Returns 0 or 1 |
324 */ | 328 */ |
325 static inline int Sk32ToBool(uint32_t n) { | 329 static inline int Sk32ToBool(uint32_t n) { |
326 return (n | (0-n)) >> 31; | 330 return (n | (0-n)) >> 31; |
327 } | 331 } |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
651 private: | 655 private: |
652 void* fPtr; | 656 void* fPtr; |
653 size_t fSize; // can be larger than the requested size (see kReuse) | 657 size_t fSize; // can be larger than the requested size (see kReuse) |
654 uint32_t fStorage[(kSize + 3) >> 2]; | 658 uint32_t fStorage[(kSize + 3) >> 2]; |
655 }; | 659 }; |
656 // Can't guard the constructor because it's a template class. | 660 // Can't guard the constructor because it's a template class. |
657 | 661 |
658 #endif /* C++ */ | 662 #endif /* C++ */ |
659 | 663 |
660 #endif | 664 #endif |
OLD | NEW |