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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 #else | 91 #else |
92 #include GR_USER_CONFIG_FILE | 92 #include GR_USER_CONFIG_FILE |
93 #endif | 93 #endif |
94 | 94 |
95 | 95 |
96 /////////////////////////////////////////////////////////////////////////////// | 96 /////////////////////////////////////////////////////////////////////////////// |
97 /////////////////////////////////////////////////////////////////////////////// | 97 /////////////////////////////////////////////////////////////////////////////// |
98 // postconfig section: | 98 // postconfig section: |
99 // | 99 // |
100 | 100 |
101 // By now we must have a GR_..._BUILD symbol set to 1, and a decision about | |
102 // debug -vs- release | |
103 // | |
104 | |
105 #define GrPrintf SkDebugf | |
106 | |
107 /** | 101 /** |
108 * GR_STRING makes a string of X where X is expanded before conversion to a str
ing | 102 * GR_STRING makes a string of X where X is expanded before conversion to a str
ing |
109 * if X itself contains macros. | 103 * if X itself contains macros. |
110 */ | 104 */ |
111 #define GR_STRING(X) GR_STRING_IMPL(X) | 105 #define GR_STRING(X) GR_STRING_IMPL(X) |
112 #define GR_STRING_IMPL(X) #X | 106 #define GR_STRING_IMPL(X) #X |
113 | 107 |
114 /** | 108 /** |
115 * GR_CONCAT concatenates X and Y where each is expanded before | 109 * GR_CONCAT concatenates X and Y where each is expanded before |
116 * contanenation if either contains macros. | 110 * contanenation if either contains macros. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 #endif | 154 #endif |
161 #endif | 155 #endif |
162 | 156 |
163 /** | 157 /** |
164 * GR_ALWAYSASSERT is an assertion in all builds. | 158 * GR_ALWAYSASSERT is an assertion in all builds. |
165 */ | 159 */ |
166 #if !defined(GR_ALWAYSASSERT) | 160 #if !defined(GR_ALWAYSASSERT) |
167 #define GR_ALWAYSASSERT(COND) \ | 161 #define GR_ALWAYSASSERT(COND) \ |
168 do { \ | 162 do { \ |
169 if (!(COND)) { \ | 163 if (!(COND)) { \ |
170 GrPrintf("%s %s failed\n", GR_FILE_AND_LINE_STR, #COND); \ | 164 SkDebugf("%s %s failed\n", GR_FILE_AND_LINE_STR, #COND); \ |
171 GR_ALWAYSBREAK; \ | 165 GR_ALWAYSBREAK; \ |
172 } \ | 166 } \ |
173 } while (false) | 167 } while (false) |
174 #endif | 168 #endif |
175 | 169 |
176 /** | 170 /** |
177 * GR_DEBUGASSERT is an assertion in debug builds only. | 171 * GR_DEBUGASSERT is an assertion in debug builds only. |
178 */ | 172 */ |
179 #if !defined(GR_DEBUGASSERT) | 173 #if !defined(GR_DEBUGASSERT) |
180 #ifdef SK_DEBUG | 174 #ifdef SK_DEBUG |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 * allocated on the stack for smaller memory requests. | 244 * allocated on the stack for smaller memory requests. |
251 * | 245 * |
252 * This is only used for memory buffers that are created and then passed through
to the | 246 * This is only used for memory buffers that are created and then passed through
to the |
253 * 3D API (e.g. as texture or geometry data) | 247 * 3D API (e.g. as texture or geometry data) |
254 */ | 248 */ |
255 #if !defined(GR_ALWAYS_ALLOCATE_ON_HEAP) | 249 #if !defined(GR_ALWAYS_ALLOCATE_ON_HEAP) |
256 #define GR_ALWAYS_ALLOCATE_ON_HEAP 0 | 250 #define GR_ALWAYS_ALLOCATE_ON_HEAP 0 |
257 #endif | 251 #endif |
258 | 252 |
259 #endif | 253 #endif |
OLD | NEW |