| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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.h" | 5 #include "ui/gl/gl_fence.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
| 9 #include "ui/gl/gl_context.h" | 9 #include "ui/gl/gl_context.h" |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 EGLDisplay display_; | 122 EGLDisplay display_; |
| 123 }; | 123 }; |
| 124 #endif // !OS_MACOSX | 124 #endif // !OS_MACOSX |
| 125 | 125 |
| 126 // static | 126 // static |
| 127 gfx::GLFence* CreateFence(bool flush) { | 127 gfx::GLFence* CreateFence(bool flush) { |
| 128 #if !defined(OS_MACOSX) | 128 #if !defined(OS_MACOSX) |
| 129 if (gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) | 129 if (gfx::g_driver_egl.ext.b_EGL_KHR_fence_sync) |
| 130 return new EGLFenceSync(flush); | 130 return new EGLFenceSync(flush); |
| 131 #endif | 131 #endif |
| 132 // Prefer ARB_sync which supports server-side wait. |
| 133 if (gfx::g_driver_gl.ext.b_GL_ARB_sync) |
| 134 return new GLFenceARBSync(flush); |
| 132 if (gfx::g_driver_gl.ext.b_GL_NV_fence) | 135 if (gfx::g_driver_gl.ext.b_GL_NV_fence) |
| 133 return new GLFenceNVFence(flush); | 136 return new GLFenceNVFence(flush); |
| 134 if (gfx::g_driver_gl.ext.b_GL_ARB_sync) | |
| 135 return new GLFenceARBSync(flush); | |
| 136 return NULL; | 137 return NULL; |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace | 140 } // namespace |
| 140 | 141 |
| 141 namespace gfx { | 142 namespace gfx { |
| 142 | 143 |
| 143 GLFence::GLFence() { | 144 GLFence::GLFence() { |
| 144 } | 145 } |
| 145 | 146 |
| 146 GLFence::~GLFence() { | 147 GLFence::~GLFence() { |
| 147 } | 148 } |
| 148 | 149 |
| 149 GLFence* GLFence::Create() { | 150 GLFence* GLFence::Create() { |
| 150 return CreateFence(true); | 151 return CreateFence(true); |
| 151 } | 152 } |
| 152 | 153 |
| 153 GLFence* GLFence::CreateWithoutFlush() { | 154 GLFence* GLFence::CreateWithoutFlush() { |
| 154 return CreateFence(false); | 155 return CreateFence(false); |
| 155 } | 156 } |
| 156 | 157 |
| 157 } // namespace gfx | 158 } // namespace gfx |
| OLD | NEW |