aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 19:45:46 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-02-07 19:45:46 +0000
commitfe1b536bb7af523995549b64ad19de6685e11411 (patch)
treed2ea589d7b1d92bd8ad6bc36447c4ee523f445b0 /bench
parentefbe8e9bedda21a3e061ebf3d96431a0f250a654 (diff)
Enhance GL error checking for non-Ganesh GL calls
Diffstat (limited to 'bench')
-rw-r--r--bench/BenchGpuTimer_gl.cpp9
-rw-r--r--bench/benchmain.cpp1
2 files changed, 9 insertions, 1 deletions
diff --git a/bench/BenchGpuTimer_gl.cpp b/bench/BenchGpuTimer_gl.cpp
index 699f5e54cf..d2de1229e5 100644
--- a/bench/BenchGpuTimer_gl.cpp
+++ b/bench/BenchGpuTimer_gl.cpp
@@ -51,9 +51,16 @@ double BenchGpuTimer::endGpu() {
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 7b1a34e5bf..2142da1668 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"