Currently, GLFenceEGL's ClientWait always uses EGL_FOREVER_KHR. This change adds a way to specify a timeout so that a thread can yield to do other work while waiting.
This is being used in the critical path for WebVR rendering, and even a 1ms delay noticeably cuts into the 16ms frame time budget. The workaround was to repeatedly poll checking for completion, but that needs a very aggressive timeout to avoid unnecessary delay. Using a timeout is more efficient.
Bug: 726026 Change-Id: I4c4292f31cf472e538cfdf18a835d48226d6ac58 Reviewed-on: https://chromium-review.googlesource.com/572663
e42561b Add ClientWaitWithTimeout to GLFenceEGL, use for WebVR
chrome/browser/android/vr_shell/vr_shell_gl.cc | 43 +++++++++++++-------------
chrome/browser/android/vr_shell/vr_shell_gl.h | 4 +--
ui/gl/gl_fence_egl.cc | 10 ++++--
ui/gl/gl_fence_egl.h | 3 ++
4 files changed, 34 insertions(+), 26 deletions(-)