| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 do { \ | 147 do { \ |
| 148 GR_GL_CALL_NOERRCHECK(IFACE, X); \ | 148 GR_GL_CALL_NOERRCHECK(IFACE, X); \ |
| 149 GR_GL_CHECK_ERROR_IMPL(IFACE, X); \ | 149 GR_GL_CHECK_ERROR_IMPL(IFACE, X); \ |
| 150 } while (false) | 150 } while (false) |
| 151 | 151 |
| 152 // Variant of above that always skips the error check. This is useful when | 152 // Variant of above that always skips the error check. This is useful when |
| 153 // the caller wants to do its own glGetError() call and examine the error value. | 153 // the caller wants to do its own glGetError() call and examine the error value. |
| 154 #define GR_GL_CALL_NOERRCHECK(IFACE, X) \ | 154 #define GR_GL_CALL_NOERRCHECK(IFACE, X) \ |
| 155 do { \ | 155 do { \ |
| 156 GR_GL_CALLBACK_IMPL(IFACE); \ | 156 GR_GL_CALLBACK_IMPL(IFACE); \ |
| 157 (IFACE)->f##X; \ | 157 (IFACE)->fFunctions.f##X; \ |
| 158 GR_GL_LOG_CALLS_IMPL(X); \ | 158 GR_GL_LOG_CALLS_IMPL(X); \ |
| 159 } while (false) | 159 } while (false) |
| 160 | 160 |
| 161 // same as GR_GL_CALL but stores the return value of the gl call in RET | 161 // same as GR_GL_CALL but stores the return value of the gl call in RET |
| 162 #define GR_GL_CALL_RET(IFACE, RET, X) \ | 162 #define GR_GL_CALL_RET(IFACE, RET, X) \ |
| 163 do { \ | 163 do { \ |
| 164 GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X); \ | 164 GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X); \ |
| 165 GR_GL_CHECK_ERROR_IMPL(IFACE, X); \ | 165 GR_GL_CHECK_ERROR_IMPL(IFACE, X); \ |
| 166 } while (false) | 166 } while (false) |
| 167 | 167 |
| 168 // same as GR_GL_CALL_RET but always skips the error check. | 168 // same as GR_GL_CALL_RET but always skips the error check. |
| 169 #define GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X) \ | 169 #define GR_GL_CALL_RET_NOERRCHECK(IFACE, RET, X) \ |
| 170 do { \ | 170 do { \ |
| 171 GR_GL_CALLBACK_IMPL(IFACE); \ | 171 GR_GL_CALLBACK_IMPL(IFACE); \ |
| 172 (RET) = (IFACE)->f##X; \ | 172 (RET) = (IFACE)->fFunctions.f##X; \ |
| 173 GR_GL_LOG_CALLS_IMPL(X); \ | 173 GR_GL_LOG_CALLS_IMPL(X); \ |
| 174 } while (false) | 174 } while (false) |
| 175 | 175 |
| 176 // call glGetError without doing a redundant error check or logging. | 176 // call glGetError without doing a redundant error check or logging. |
| 177 #define GR_GL_GET_ERROR(IFACE) (IFACE)->fGetError() | 177 #define GR_GL_GET_ERROR(IFACE) (IFACE)->fFunctions.fGetError() |
| 178 | 178 |
| 179 #endif | 179 #endif |
| OLD | NEW |