OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #define GR_DEBUGASSERT(COND) | 171 #define GR_DEBUGASSERT(COND) |
172 #endif | 172 #endif |
173 #endif | 173 #endif |
174 | 174 |
175 /** | 175 /** |
176 * Prettier forms of the above macros. | 176 * Prettier forms of the above macros. |
177 */ | 177 */ |
178 #define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND) | 178 #define GrAlwaysAssert(COND) GR_ALWAYSASSERT(COND) |
179 | 179 |
180 /** | 180 /** |
181 * Crash from unrecoverable condition, optionally with a message. The debug vari
ants only | |
182 * crash in a debug build. The message versions print the message regardless of
release vs debug. | |
183 */ | |
184 inline void GrCrash() { GrAlwaysAssert(false); } | |
185 inline void GrCrash(const char* msg) { GrPrintf(msg); GrAlwaysAssert(false); } | |
186 inline void GrDebugCrash() { SkASSERT(false); } | |
187 inline void GrDebugCrash(const char* msg) { GrPrintf(msg); SkASSERT(false); } | |
188 | |
189 /** | |
190 * GR_STATIC_ASSERT is a compile time assertion. Depending on the platform | 181 * GR_STATIC_ASSERT is a compile time assertion. Depending on the platform |
191 * it may print the message in the compiler log. Obviously, the condition must | 182 * it may print the message in the compiler log. Obviously, the condition must |
192 * be evaluatable at compile time. | 183 * be evaluatable at compile time. |
193 */ | 184 */ |
194 // VS 2010 and GCC compiled with c++0x or gnu++0x support the new | 185 // VS 2010 and GCC compiled with c++0x or gnu++0x support the new |
195 // static_assert. | 186 // static_assert. |
196 #if !defined(GR_STATIC_ASSERT) | 187 #if !defined(GR_STATIC_ASSERT) |
197 #if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_C
XX0X__) && __GXX_EXPERIMENTAL_CXX0X__) | 188 #if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GXX_EXPERIMENTAL_C
XX0X__) && __GXX_EXPERIMENTAL_CXX0X__) |
198 #define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug") | 189 #define GR_STATIC_ASSERT(CONDITION) static_assert(CONDITION, "bug") |
199 #else | 190 #else |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 226 |
236 /** | 227 /** |
237 * GR_STROKE_PATH_RENDERING controls whether or not the GrStrokePathRenderer can
be selected | 228 * GR_STROKE_PATH_RENDERING controls whether or not the GrStrokePathRenderer can
be selected |
238 * as a path renderer. GrStrokePathRenderer is currently an experimental path re
nderer. | 229 * as a path renderer. GrStrokePathRenderer is currently an experimental path re
nderer. |
239 */ | 230 */ |
240 #if !defined(GR_STROKE_PATH_RENDERING) | 231 #if !defined(GR_STROKE_PATH_RENDERING) |
241 #define GR_STROKE_PATH_RENDERING 0 | 232 #define GR_STROKE_PATH_RENDERING 0 |
242 #endif | 233 #endif |
243 | 234 |
244 #endif | 235 #endif |
OLD | NEW |