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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #define SkDEBUGF(args) | 108 #define SkDEBUGF(args) |
109 #define SkDECLAREPARAM(type, var) | 109 #define SkDECLAREPARAM(type, var) |
110 #define SkPARAM(var) | 110 #define SkPARAM(var) |
111 | 111 |
112 // unlike SkASSERT, this guy executes its condition in the non-debug build | 112 // unlike SkASSERT, this guy executes its condition in the non-debug build |
113 #define SkAssertResult(cond) cond | 113 #define SkAssertResult(cond) cond |
114 #endif | 114 #endif |
115 | 115 |
116 #define SkFAIL(message) SK_ALWAYSBREAK(false && message) | 116 #define SkFAIL(message) SK_ALWAYSBREAK(false && message) |
117 | 117 |
| 118 // We want to evaluate cond only once, and inside the SkASSERT somewhere so we s
ee its string form. |
| 119 // So we use the comma operator to make an SkDebugf that always returns false: w
e'll evaluate cond, |
| 120 // and if it's true the assert passes; if it's false, we'll print the message an
d the assert fails. |
| 121 #define SkASSERTF(cond, fmt, ...) SkASSERT((cond) || (SkDebugf(fmt"\n", __
VA_ARGS__), false)) |
| 122 |
118 #ifdef SK_DEVELOPER | 123 #ifdef SK_DEVELOPER |
119 #define SkDEVCODE(code) code | 124 #define SkDEVCODE(code) code |
120 #else | 125 #else |
121 #define SkDEVCODE(code) | 126 #define SkDEVCODE(code) |
122 #endif | 127 #endif |
123 | 128 |
124 #ifdef SK_IGNORE_TO_STRING | 129 #ifdef SK_IGNORE_TO_STRING |
125 #define SK_TO_STRING_NONVIRT() | 130 #define SK_TO_STRING_NONVIRT() |
126 #define SK_TO_STRING_VIRT() | 131 #define SK_TO_STRING_VIRT() |
127 #define SK_TO_STRING_PUREVIRT() | 132 #define SK_TO_STRING_PUREVIRT() |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 private: | 662 private: |
658 void* fPtr; | 663 void* fPtr; |
659 size_t fSize; // can be larger than the requested size (see kReuse) | 664 size_t fSize; // can be larger than the requested size (see kReuse) |
660 uint32_t fStorage[(kSize + 3) >> 2]; | 665 uint32_t fStorage[(kSize + 3) >> 2]; |
661 }; | 666 }; |
662 // Can't guard the constructor because it's a template class. | 667 // Can't guard the constructor because it's a template class. |
663 | 668 |
664 #endif /* C++ */ | 669 #endif /* C++ */ |
665 | 670 |
666 #endif | 671 #endif |
OLD | NEW |