aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/BenchGpuTimer_gl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bench/BenchGpuTimer_gl.cpp')
-rw-r--r--bench/BenchGpuTimer_gl.cpp9
1 files changed, 8 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,