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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 /** Returns a < b for milliseconds, correctly handling wrap-around from 0xFFFFFF
FF to 0 | 318 /** Returns a < b for milliseconds, correctly handling wrap-around from 0xFFFFFF
FF to 0 |
319 */ | 319 */ |
320 #define SkMSec_LT(a, b) ((int32_t)(a) - (int32_t)(b) < 0) | 320 #define SkMSec_LT(a, b) ((int32_t)(a) - (int32_t)(b) < 0) |
321 /** Returns a <= b for milliseconds, correctly handling wrap-around from 0xFFFFF
FFF to 0 | 321 /** Returns a <= b for milliseconds, correctly handling wrap-around from 0xFFFFF
FFF to 0 |
322 */ | 322 */ |
323 #define SkMSec_LE(a, b) ((int32_t)(a) - (int32_t)(b) <= 0) | 323 #define SkMSec_LE(a, b) ((int32_t)(a) - (int32_t)(b) <= 0) |
324 | 324 |
325 /** The generation IDs in Skia reserve 0 has an invalid marker. | 325 /** The generation IDs in Skia reserve 0 has an invalid marker. |
326 */ | 326 */ |
327 #define SK_InvalidGenID 0 | 327 #define SK_InvalidGenID 0 |
| 328 /** The unique IDs in Skia reserve 0 has an invalid marker. |
| 329 */ |
| 330 #define SK_InvalidUniqueID 0 |
328 | 331 |
329 /**************************************************************************** | 332 /**************************************************************************** |
330 The rest of these only build with C++ | 333 The rest of these only build with C++ |
331 */ | 334 */ |
332 #ifdef __cplusplus | 335 #ifdef __cplusplus |
333 | 336 |
334 /** Faster than SkToBool for integral conditions. Returns 0 or 1 | 337 /** Faster than SkToBool for integral conditions. Returns 0 or 1 |
335 */ | 338 */ |
336 static inline int Sk32ToBool(uint32_t n) { | 339 static inline int Sk32ToBool(uint32_t n) { |
337 return (n | (0-n)) >> 31; | 340 return (n | (0-n)) >> 31; |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 private: | 665 private: |
663 void* fPtr; | 666 void* fPtr; |
664 size_t fSize; // can be larger than the requested size (see kReuse) | 667 size_t fSize; // can be larger than the requested size (see kReuse) |
665 uint32_t fStorage[(kSize + 3) >> 2]; | 668 uint32_t fStorage[(kSize + 3) >> 2]; |
666 }; | 669 }; |
667 // Can't guard the constructor because it's a template class. | 670 // Can't guard the constructor because it's a template class. |
668 | 671 |
669 #endif /* C++ */ | 672 #endif /* C++ */ |
670 | 673 |
671 #endif | 674 #endif |
OLD | NEW |