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/egl_util.h" | 7 #include "ui/gl/egl_util.h" |
8 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
9 | 9 |
10 namespace gfx { | 10 namespace gl { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 bool g_ignore_egl_sync_failures = false; | 14 bool g_ignore_egl_sync_failures = false; |
15 | 15 |
16 } // namespace | 16 } // namespace |
17 | 17 |
18 // static | 18 // static |
19 void GLFenceEGL::SetIgnoreFailures() { | 19 void GLFenceEGL::SetIgnoreFailures() { |
20 g_ignore_egl_sync_failures = true; | 20 g_ignore_egl_sync_failures = true; |
(...skipping 25 matching lines...) Expand all Loading... |
46 EGLint result = eglClientWaitSyncKHR(display_, sync_, flags, time); | 46 EGLint result = eglClientWaitSyncKHR(display_, sync_, flags, time); |
47 DCHECK(g_ignore_egl_sync_failures || EGL_TIMEOUT_EXPIRED_KHR != result); | 47 DCHECK(g_ignore_egl_sync_failures || EGL_TIMEOUT_EXPIRED_KHR != result); |
48 if (result == EGL_FALSE) { | 48 if (result == EGL_FALSE) { |
49 LOG(ERROR) << "Failed to wait for EGLSync. error:" | 49 LOG(ERROR) << "Failed to wait for EGLSync. error:" |
50 << ui::GetLastEGLErrorString(); | 50 << ui::GetLastEGLErrorString(); |
51 CHECK(g_ignore_egl_sync_failures); | 51 CHECK(g_ignore_egl_sync_failures); |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
55 void GLFenceEGL::ServerWait() { | 55 void GLFenceEGL::ServerWait() { |
56 if (!gfx::g_driver_egl.ext.b_EGL_KHR_wait_sync) { | 56 if (!gl::g_driver_egl.ext.b_EGL_KHR_wait_sync) { |
57 ClientWait(); | 57 ClientWait(); |
58 return; | 58 return; |
59 } | 59 } |
60 EGLint flags = 0; | 60 EGLint flags = 0; |
61 if (eglWaitSyncKHR(display_, sync_, flags) == EGL_FALSE) { | 61 if (eglWaitSyncKHR(display_, sync_, flags) == EGL_FALSE) { |
62 LOG(ERROR) << "Failed to wait for EGLSync. error:" | 62 LOG(ERROR) << "Failed to wait for EGLSync. error:" |
63 << ui::GetLastEGLErrorString(); | 63 << ui::GetLastEGLErrorString(); |
64 CHECK(g_ignore_egl_sync_failures); | 64 CHECK(g_ignore_egl_sync_failures); |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 GLFenceEGL::~GLFenceEGL() { | 68 GLFenceEGL::~GLFenceEGL() { |
69 eglDestroySyncKHR(display_, sync_); | 69 eglDestroySyncKHR(display_, sync_); |
70 } | 70 } |
71 | 71 |
72 } // namespace gfx | 72 } // namespace gl |
OLD | NEW |