OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
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 GrGLUtil_DEFINED | 8 #ifndef GrGLUtil_DEFINED |
9 #define GrGLUtil_DEFINED | 9 #define GrGLUtil_DEFINED |
10 | 10 |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 // run-time flags. | 123 // run-time flags. |
124 #if GR_GL_CHECK_ERROR | 124 #if GR_GL_CHECK_ERROR |
125 extern bool gCheckErrorGL; | 125 extern bool gCheckErrorGL; |
126 #define GR_GL_CHECK_ERROR_IMPL(IFACE, X) \ | 126 #define GR_GL_CHECK_ERROR_IMPL(IFACE, X) \ |
127 if (gCheckErrorGL) \ | 127 if (gCheckErrorGL) \ |
128 GrGLCheckErr(IFACE, GR_FILE_AND_LINE_STR, #X) | 128 GrGLCheckErr(IFACE, GR_FILE_AND_LINE_STR, #X) |
129 #else | 129 #else |
130 #define GR_GL_CHECK_ERROR_IMPL(IFACE, X) | 130 #define GR_GL_CHECK_ERROR_IMPL(IFACE, X) |
131 #endif | 131 #endif |
132 | 132 |
133 // internal macro to conditionally log the gl call using GrPrintf based on | 133 // internal macro to conditionally log the gl call using SkDebugf based on |
134 // compile-time and run-time flags. | 134 // compile-time and run-time flags. |
135 #if GR_GL_LOG_CALLS | 135 #if GR_GL_LOG_CALLS |
136 extern bool gLogCallsGL; | 136 extern bool gLogCallsGL; |
137 #define GR_GL_LOG_CALLS_IMPL(X) \ | 137 #define GR_GL_LOG_CALLS_IMPL(X) \ |
138 if (gLogCallsGL) \ | 138 if (gLogCallsGL) \ |
139 GrPrintf(GR_FILE_AND_LINE_STR "GL: " #X "\n") | 139 SkDebugf(GR_FILE_AND_LINE_STR "GL: " #X "\n") |
140 #else | 140 #else |
141 #define GR_GL_LOG_CALLS_IMPL(X) | 141 #define GR_GL_LOG_CALLS_IMPL(X) |
142 #endif | 142 #endif |
143 | 143 |
144 // internal macro that does the per-GL-call callback (if necessary) | 144 // internal macro that does the per-GL-call callback (if necessary) |
145 #if GR_GL_PER_GL_FUNC_CALLBACK | 145 #if GR_GL_PER_GL_FUNC_CALLBACK |
146 #define GR_GL_CALLBACK_IMPL(IFACE) (IFACE)->fCallback(IFACE) | 146 #define GR_GL_CALLBACK_IMPL(IFACE) (IFACE)->fCallback(IFACE) |
147 #else | 147 #else |
148 #define GR_GL_CALLBACK_IMPL(IFACE) | 148 #define GR_GL_CALLBACK_IMPL(IFACE) |
149 #endif | 149 #endif |
(...skipping 29 matching lines...) Expand all Loading... |
179 GR_GL_LOG_CALLS_IMPL(X); \ | 179 GR_GL_LOG_CALLS_IMPL(X); \ |
180 } while (false) | 180 } while (false) |
181 | 181 |
182 // call glGetError without doing a redundant error check or logging. | 182 // call glGetError without doing a redundant error check or logging. |
183 #define GR_GL_GET_ERROR(IFACE) (IFACE)->fFunctions.fGetError() | 183 #define GR_GL_GET_ERROR(IFACE) (IFACE)->fFunctions.fGetError() |
184 | 184 |
185 GrGLenum GrToGLStencilFunc(GrStencilFunc basicFunc); | 185 GrGLenum GrToGLStencilFunc(GrStencilFunc basicFunc); |
186 | 186 |
187 | 187 |
188 #endif | 188 #endif |
OLD | NEW |