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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 namespace gfx { | 75 namespace gfx { |
76 | 76 |
77 GLFence::GLFence() { | 77 GLFence::GLFence() { |
78 } | 78 } |
79 | 79 |
80 GLFence::~GLFence() { | 80 GLFence::~GLFence() { |
81 } | 81 } |
82 | 82 |
83 // static | 83 // static |
84 GLFence* GLFence::Create() { | 84 GLFence* GLFence::Create() { |
85 if (gfx::g_GL_NV_fence) { | 85 if (gfx::g_driver_gl.ext.b_GL_NV_fence) { |
86 return new GLFenceNVFence(); | 86 return new GLFenceNVFence(); |
87 } else if (gfx::g_GL_ARB_sync) { | 87 } else if (gfx::g_driver_gl.ext.b_GL_ARB_sync) { |
88 return new GLFenceARBSync(); | 88 return new GLFenceARBSync(); |
89 } else { | 89 } else { |
90 return NULL; | 90 return NULL; |
91 } | 91 } |
92 } | 92 } |
93 | 93 |
94 // static | 94 // static |
95 bool GLFence::IsContextLost() { | 95 bool GLFence::IsContextLost() { |
96 if (!gfx::g_GL_ARB_robustness && !gfx::g_GL_EXT_robustness) | 96 if (!gfx::g_driver_gl.ext.b_GL_ARB_robustness && |
| 97 !gfx::g_driver_gl.ext.b_GL_EXT_robustness) |
97 return false; | 98 return false; |
98 | 99 |
99 if (!gfx::GLContext::GetCurrent() || | 100 if (!gfx::GLContext::GetCurrent() || |
100 !gfx::GLContext::GetCurrent()-> | 101 !gfx::GLContext::GetCurrent()-> |
101 WasAllocatedUsingRobustnessExtension()) | 102 WasAllocatedUsingRobustnessExtension()) |
102 return false; | 103 return false; |
103 | 104 |
104 GLenum status = glGetGraphicsResetStatusARB(); | 105 GLenum status = glGetGraphicsResetStatusARB(); |
105 return status != GL_NO_ERROR; | 106 return status != GL_NO_ERROR; |
106 } | 107 } |
107 | 108 |
108 } // namespace gfx | 109 } // namespace gfx |
OLD | NEW |