OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/gl/gl_fence_egl.h" | 5 #include "ui/gl/gl_fence_egl.h" |
6 | 6 |
7 #include "ui/gl/gl_bindings.h" | 7 #include "ui/gl/gl_bindings.h" |
8 #include "ui/gl/gl_context.h" | 8 #include "ui/gl/gl_context.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gfx { |
(...skipping 24 matching lines...) Expand all Loading... |
35 if (!flush_event_.get() || flush_event_->IsSignaled()) { | 35 if (!flush_event_.get() || flush_event_->IsSignaled()) { |
36 EGLint flags = 0; | 36 EGLint flags = 0; |
37 EGLTimeKHR time = EGL_FOREVER_KHR; | 37 EGLTimeKHR time = EGL_FOREVER_KHR; |
38 eglClientWaitSyncKHR(display_, sync_, flags, time); | 38 eglClientWaitSyncKHR(display_, sync_, flags, time); |
39 } else { | 39 } else { |
40 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; | 40 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; |
41 } | 41 } |
42 } | 42 } |
43 | 43 |
44 void GLFenceEGL::ServerWait() { | 44 void GLFenceEGL::ServerWait() { |
| 45 if (!gfx::g_driver_egl.ext.b_EGL_KHR_wait_sync) { |
| 46 ClientWait(); |
| 47 return; |
| 48 } |
45 if (!flush_event_.get() || flush_event_->IsSignaled()) { | 49 if (!flush_event_.get() || flush_event_->IsSignaled()) { |
46 EGLint flags = 0; | 50 EGLint flags = 0; |
47 eglWaitSyncKHR(display_, sync_, flags); | 51 eglWaitSyncKHR(display_, sync_, flags); |
48 } else { | 52 } else { |
49 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; | 53 LOG(ERROR) << "Trying to wait for uncommitted fence. Skipping..."; |
50 } | 54 } |
51 } | 55 } |
52 | 56 |
53 GLFenceEGL::~GLFenceEGL() { | 57 GLFenceEGL::~GLFenceEGL() { |
54 eglDestroySyncKHR(display_, sync_); | 58 eglDestroySyncKHR(display_, sync_); |
55 } | 59 } |
56 | 60 |
57 } // namespace gfx | 61 } // namespace gfx |
OLD | NEW |