blob: 5a57ac49a755db081a30f432e6e14089b3279486 [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
13void GrGLClearErr() {
14 while (GR_GL_NO_ERROR != GrGLGetGLInterface()->fGetError()) {}
15}
bsalomon@google.com27847de2011-02-22 20:59:41 +000016
17void GrGLCheckErr(const char* location, const char* call) {
twiz@google.com59a190b2011-03-14 21:23:01 +000018 uint32_t err = GrGLGetGLInterface()->fGetError();
twiz@google.com0f31ca72011-03-18 17:38:11 +000019 if (GR_GL_NO_ERROR != err) {
bsalomon@google.com27847de2011-02-22 20:59:41 +000020 GrPrintf("---- glGetError %x", err);
21 if (NULL != location) {
22 GrPrintf(" at\n\t%s", location);
23 }
24 if (NULL != call) {
25 GrPrintf("\n\t\t%s", call);
26 }
27 GrPrintf("\n");
28 }
29}
30
bsalomon@google.comf987d1b2011-04-04 17:13:52 +000031void GrGLRestoreResetRowLength() {
32 if (GR_GL_SUPPORT_DESKTOP) {
33 GR_GL(PixelStorei(GR_GL_UNPACK_ROW_LENGTH, 0));
34 }
35}
36
bsalomon@google.com27847de2011-02-22 20:59:41 +000037///////////////////////////////////////////////////////////////////////////////
38
bsalomon@google.comd5d10492011-04-28 21:16:31 +000039#if GR_GL_LOG_CALLS
40 bool gLogCallsGL = !!(GR_GL_LOG_CALLS_START);
41#endif
bsalomon@google.com27847de2011-02-22 20:59:41 +000042
bsalomon@google.comd5d10492011-04-28 21:16:31 +000043#if GR_GL_CHECK_ERROR
44 bool gCheckErrorGL = !!(GR_GL_CHECK_ERROR_START);
45#endif
46