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 // IWYU pragma: private, include "SkTypes.h" | 8 // IWYU pragma: private, include "SkTypes.h" |
9 | 9 |
10 #ifndef SkPostConfig_DEFINED | 10 #ifndef SkPostConfig_DEFINED |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 # ifndef SK_A32_SHIFT | 141 # ifndef SK_A32_SHIFT |
142 # define SK_A32_SHIFT 24 | 142 # define SK_A32_SHIFT 24 |
143 # define SK_R32_SHIFT 16 | 143 # define SK_R32_SHIFT 16 |
144 # define SK_G32_SHIFT 8 | 144 # define SK_G32_SHIFT 8 |
145 # define SK_B32_SHIFT 0 | 145 # define SK_B32_SHIFT 0 |
146 # endif | 146 # endif |
147 # | 147 # |
148 #endif | 148 #endif |
149 | 149 |
150 #ifndef SK_ALWAYSBREAK | 150 #ifndef SK_ALWAYSBREAK |
151 # ifdef SK_DEBUG | 151 # if defined(GOOGLE3) |
| 152 void DebugWriteToStderr(const char*, void*); |
| 153 void DumpStackTrace(int skip_count, void w(const char*, void*), |
| 154 void* arg); |
152 # define SK_ALWAYSBREAK(cond) do { \ | 155 # define SK_ALWAYSBREAK(cond) do { \ |
153 if (cond) break; \ | 156 if (cond) break; \ |
154 SkNO_RETURN_HINT(); \ | 157 SkNO_RETURN_HINT(); \ |
| 158 SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, #
cond); \ |
| 159 DumpStackTrace(0, DebugWriteToStderr, nullptr); \ |
| 160 SK_CRASH(); \ |
| 161 } while (false) |
| 162 # elif defined(SK_DEBUG) |
| 163 # define SK_ALWAYSBREAK(cond) do { \ |
| 164 if (cond) break; \ |
| 165 SkNO_RETURN_HINT(); \ |
155 SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, #
cond); \ | 166 SkDebugf("%s:%d: failed assertion \"%s\"\n", __FILE__, __LINE__, #
cond); \ |
156 SK_CRASH(); \ | 167 SK_CRASH(); \ |
157 } while (false) | 168 } while (false) |
158 # else | 169 # else |
159 # define SK_ALWAYSBREAK(cond) do { if (cond) break; SK_CRASH(); } while (fals
e) | 170 # define SK_ALWAYSBREAK(cond) do { if (cond) break; SK_CRASH(); } while (fals
e) |
160 # endif | 171 # endif |
161 #endif | 172 #endif |
162 | 173 |
163 /** | 174 /** |
164 * We check to see if the SHIFT value has already been defined. | 175 * We check to see if the SHIFT value has already been defined. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 # define SK_GAMMA_EXPONENT (2.2f) | 363 # define SK_GAMMA_EXPONENT (2.2f) |
353 #endif | 364 #endif |
354 | 365 |
355 ////////////////////////////////////////////////////////////////////// | 366 ////////////////////////////////////////////////////////////////////// |
356 | 367 |
357 #ifndef GR_TEST_UTILS | 368 #ifndef GR_TEST_UTILS |
358 # define GR_TEST_UTILS 1 | 369 # define GR_TEST_UTILS 1 |
359 #endif | 370 #endif |
360 | 371 |
361 #endif // SkPostConfig_DEFINED | 372 #endif // SkPostConfig_DEFINED |
OLD | NEW |