blob: 2cb887a363241ae40709626052cd9aafd260e8aa [file] [log] [blame]
bsalomon@google.com27847de2011-02-22 20:59:41 +00001/*
twiz@google.com59a190b2011-03-14 21:23:01 +00002 Copyright 2011 Google Inc.
bsalomon@google.com27847de2011-02-22 20:59:41 +00003
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.com27847de2011-02-22 20:59:41 +000018
19void GrGLCheckErr(const char* location, const char* call) {
twiz@google.com59a190b2011-03-14 21:23:01 +000020 uint32_t err = GrGLGetGLInterface()->fGetError();
bsalomon@google.com27847de2011-02-22 20:59:41 +000021 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
35bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START);
36
37bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START);