Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: ui/gl/gl_fence_arb.cc

Issue 685003007: Check if there is error on waiting for GL Fence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: not use GL_SYNC_FLUSH_COMMANDS_BIT Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698