| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
| 10 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #else | 36 #else |
| 37 g_driver_egl.ext.b_EGL_KHR_fence_sync || | 37 g_driver_egl.ext.b_EGL_KHR_fence_sync || |
| 38 #endif | 38 #endif |
| 39 g_driver_gl.ext.b_GL_NV_fence; | 39 g_driver_gl.ext.b_GL_NV_fence; |
| 40 } | 40 } |
| 41 | 41 |
| 42 GLFence* GLFence::Create() { | 42 GLFence* GLFence::Create() { |
| 43 DCHECK(GLContext::GetCurrent()) | 43 DCHECK(GLContext::GetCurrent()) |
| 44 << "Trying to create fence with no context"; | 44 << "Trying to create fence with no context"; |
| 45 | 45 |
| 46 scoped_ptr<GLFence> fence; | 46 std::unique_ptr<GLFence> fence; |
| 47 // Prefer ARB_sync which supports server-side wait. | 47 // Prefer ARB_sync which supports server-side wait. |
| 48 if (g_driver_gl.ext.b_GL_ARB_sync || | 48 if (g_driver_gl.ext.b_GL_ARB_sync || |
| 49 GetGLVersionInfo()->is_es3 || | 49 GetGLVersionInfo()->is_es3 || |
| 50 GetGLImplementation() == kGLImplementationDesktopGLCoreProfile) { | 50 GetGLImplementation() == kGLImplementationDesktopGLCoreProfile) { |
| 51 fence.reset(new GLFenceARB); | 51 fence.reset(new GLFenceARB); |
| 52 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 53 } else if (g_driver_gl.ext.b_GL_APPLE_fence) { | 53 } else if (g_driver_gl.ext.b_GL_APPLE_fence) { |
| 54 fence.reset(new GLFenceAPPLE); | 54 fence.reset(new GLFenceAPPLE); |
| 55 #else | 55 #else |
| 56 } else if (g_driver_egl.ext.b_EGL_KHR_fence_sync) { | 56 } else if (g_driver_egl.ext.b_EGL_KHR_fence_sync) { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 67 bool GLFence::ResetSupported() { | 67 bool GLFence::ResetSupported() { |
| 68 // Resetting a fence to its original state isn't supported by default. | 68 // Resetting a fence to its original state isn't supported by default. |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 | 71 |
| 72 void GLFence::ResetState() { | 72 void GLFence::ResetState() { |
| 73 NOTIMPLEMENTED(); | 73 NOTIMPLEMENTED(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 } // namespace gfx | 76 } // namespace gfx |
| OLD | NEW |