Enhance GL error checking for non-Ganesh GL calls
https://codereview.appspot.com/7312057/
git-svn-id: http://skia.googlecode.com/svn/trunk@7647 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/bench/BenchGpuTimer_gl.cpp b/bench/BenchGpuTimer_gl.cpp
index 699f5e5..d2de122 100644
--- a/bench/BenchGpuTimer_gl.cpp
+++ b/bench/BenchGpuTimer_gl.cpp
@@ -51,9 +51,16 @@
GrGLint available = 0;
while (!available) {
- SK_GL(*fContext, GetQueryObjectiv(fQuery,
+ SK_GL_NOERRCHECK(*fContext, GetQueryObjectiv(fQuery,
GR_GL_QUERY_RESULT_AVAILABLE,
&available));
+ // If GetQueryObjectiv is erroring out we need some alternative
+ // means of breaking out of this loop
+ GrGLenum error;
+ SK_GL_RET_NOERRCHECK(*fContext, error, GetError());
+ if (GR_GL_NO_ERROR != error) {
+ break;
+ }
}
GrGLuint64 totalGPUTimeElapsed = 0;
SK_GL(*fContext, GetQueryObjectui64v(fQuery,
diff --git a/bench/benchmain.cpp b/bench/benchmain.cpp
index 7b1a34e..2142da1 100644
--- a/bench/benchmain.cpp
+++ b/bench/benchmain.cpp
@@ -11,6 +11,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
+#include "gl/GrGLDefines.h"
#include "GrRenderTarget.h"
#if SK_ANGLE
#include "gl/SkANGLEGLContext.h"