Index: ui/gl/gl_fence_arb.cc |
diff --git a/ui/gl/gl_fence_arb.cc b/ui/gl/gl_fence_arb.cc |
index da13f107880d8ae0c996218af9d75fad46470932..814823793a6df68a633dd7a290f9867dd20bc49e 100644 |
--- a/ui/gl/gl_fence_arb.cc |
+++ b/ui/gl/gl_fence_arb.cc |
@@ -28,7 +28,12 @@ bool GLFenceARB::HasCompleted() { |
// We could potentially use glGetSynciv here, but it doesn't work |
// on OSX 10.7 (always says the fence is not signaled yet). |
// glClientWaitSync works better, so let's use that instead. |
- return glClientWaitSync(sync_, 0, 0) != GL_TIMEOUT_EXPIRED; |
+ GLenum result = glClientWaitSync(sync_, 0, 0); |
+ if (result == GL_WAIT_FAILED) { |
+ NOTREACHED(); |
no sievers
2014/11/03 19:05:02
How about LOG(FATAL) instead (and removing NOTREAC
dshwang
2014/11/04 13:55:08
Yes, I used FATAL, but I'm afraid of it can crash
no sievers
2014/11/04 19:12:56
That's good in a way, because we will get crash re
|
+ LOG(ERROR) << "Fail to wait for legal GLFence. error code:" << glGetError(); |
no sievers
2014/11/03 19:05:03
You have to loop over it until it stops returning
dshwang
2014/11/04 13:55:08
Most existing code don't do loop-checking. I think
no sievers
2014/11/04 19:12:56
The problem is that you cannot clear the previous
|
+ } |
+ return result != GL_TIMEOUT_EXPIRED; |
no sievers
2014/11/03 19:05:02
If you return explicitly above, you can DCHECK_NE(
dshwang
2014/11/04 13:55:08
even if we don't set a timeout, GL_TIMEOUT_EXPIRED
|
} |
void GLFenceARB::ClientWait() { |