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 // This file implements the GLContextWGL and PbufferGLContext classes. | 5 // This file implements the GLContextWGL and PbufferGLContext classes. |
6 | 6 |
7 #include "ui/gl/gl_context_wgl.h" | 7 #include "ui/gl/gl_context_wgl.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 void* GLContextWGL::GetHandle() { | 147 void* GLContextWGL::GetHandle() { |
148 return context_; | 148 return context_; |
149 } | 149 } |
150 | 150 |
151 void GLContextWGL::OnSetSwapInterval(int interval) { | 151 void GLContextWGL::OnSetSwapInterval(int interval) { |
152 DCHECK(IsCurrent(nullptr)); | 152 DCHECK(IsCurrent(nullptr)); |
153 if (gl::g_driver_wgl.ext.b_WGL_EXT_swap_control) { | 153 if (g_driver_wgl.ext.b_WGL_EXT_swap_control) { |
154 wglSwapIntervalEXT(interval); | 154 wglSwapIntervalEXT(interval); |
155 } else { | 155 } else { |
156 LOG(WARNING) << | 156 LOG(WARNING) << |
157 "Could not disable vsync: driver does not " | 157 "Could not disable vsync: driver does not " |
158 "support WGL_EXT_swap_control"; | 158 "support WGL_EXT_swap_control"; |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 std::string GLContextWGL::GetExtensions() { | 162 std::string GLContextWGL::GetExtensions() { |
163 const char* extensions = nullptr; | 163 const char* extensions = nullptr; |
164 if (g_driver_wgl.fn.wglGetExtensionsStringARBFn) | 164 if (g_driver_wgl.fn.wglGetExtensionsStringARBFn) |
165 extensions = wglGetExtensionsStringARB(GLSurfaceWGL::GetDisplayDC()); | 165 extensions = wglGetExtensionsStringARB(GLSurfaceWGL::GetDisplayDC()); |
166 else if (g_driver_wgl.fn.wglGetExtensionsStringEXTFn) | 166 else if (g_driver_wgl.fn.wglGetExtensionsStringEXTFn) |
167 extensions = wglGetExtensionsStringEXT(); | 167 extensions = wglGetExtensionsStringEXT(); |
168 | 168 |
169 if (extensions) | 169 if (extensions) |
170 return GLContext::GetExtensions() + " " + extensions; | 170 return GLContext::GetExtensions() + " " + extensions; |
171 | 171 |
172 return GLContext::GetExtensions(); | 172 return GLContext::GetExtensions(); |
173 } | 173 } |
174 | 174 |
175 GLContextWGL::~GLContextWGL() { | 175 GLContextWGL::~GLContextWGL() { |
176 Destroy(); | 176 Destroy(); |
177 } | 177 } |
178 | 178 |
179 } // namespace gl | 179 } // namespace gl |
OLD | NEW |