blob: f12b407b1a32d7a597cf1211a1eb9d0156efc42e [file] [log] [blame]
epoger@google.comec3ed6a2011-07-28 14:26:00 +00001
bsalomon@google.com27847de2011-02-22 20:59:41 +00002/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00003 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
bsalomon@google.com27847de2011-02-22 20:59:41 +00007 */
8
epoger@google.comec3ed6a2011-07-28 14:26:00 +00009
bsalomon@google.com27847de2011-02-22 20:59:41 +000010#include "GrGLConfig.h"
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000011#include "GrGLInterface.h"
12
bsalomon@google.com0b77d682011-08-19 13:28:54 +000013void GrGLClearErr(const GrGLInterface* gl) {
14 while (GR_GL_NO_ERROR != gl->fGetError()) {}
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000015}
bsalomon@google.com27847de2011-02-22 20:59:41 +000016
bsalomon@google.com0b77d682011-08-19 13:28:54 +000017void GrGLCheckErr(const GrGLInterface* gl,
18 const char* location,
19 const char* call) {
20 uint32_t err = GR_GL_GET_ERROR(gl);
twiz@google.com0f31ca72011-03-18 17:38:11 +000021 if (GR_GL_NO_ERROR != err) {
bsalomon@google.com4fdfcbe2011-09-28 17:58:13 +000022 GrPrintf("---- glGetError %x", err);
bsalomon@google.com27847de2011-02-22 20:59:41 +000023 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
bsalomon@google.comd5d10492011-04-28 21:16:31 +000035#if GR_GL_LOG_CALLS
36 bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START);
37#endif
bsalomon@google.com27847de2011-02-22 20:59:41 +000038
bsalomon@google.comd5d10492011-04-28 21:16:31 +000039#if GR_GL_CHECK_ERROR
40 bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START);
41#endif
42