bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 1 | /* |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame^] | 2 | Copyright 2011 Google Inc. |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include "GrGLConfig.h" |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 18 | |
| 19 | void GrGLCheckErr(const char* location, const char* call) { |
twiz@google.com | 59a190b | 2011-03-14 21:23:01 +0000 | [diff] [blame^] | 20 | uint32_t err = GrGLGetGLInterface()->fGetError(); |
bsalomon@google.com | 27847de | 2011-02-22 20:59:41 +0000 | [diff] [blame] | 21 | if (GL_NO_ERROR != err) { |
| 22 | GrPrintf("---- glGetError %x", err); |
| 23 | if (NULL != location) { |
| 24 | GrPrintf(" at\n\t%s", location); |
| 25 | } |
| 26 | if (NULL != call) { |
| 27 | GrPrintf("\n\t\t%s", call); |
| 28 | } |
| 29 | GrPrintf("\n"); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | /////////////////////////////////////////////////////////////////////////////// |
| 34 | |
| 35 | bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START); |
| 36 | |
| 37 | bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START); |