| 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 extern "C" { | 5 extern "C" { |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 } | 7 } |
| 8 | 8 |
| 9 #include "ui/gl/gl_context_glx.h" | 9 #include "ui/gl/gl_context_glx.h" |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 return true; | 213 return true; |
| 214 } | 214 } |
| 215 | 215 |
| 216 void* GLContextGLX::GetHandle() { | 216 void* GLContextGLX::GetHandle() { |
| 217 return context_; | 217 return context_; |
| 218 } | 218 } |
| 219 | 219 |
| 220 void GLContextGLX::SetSwapInterval(int interval) { | 220 void GLContextGLX::SetSwapInterval(int interval) { |
| 221 DCHECK(IsCurrent(NULL)); | 221 DCHECK(IsCurrent(NULL)); |
| 222 if (HasExtension("GLX_EXT_swap_control") && glXSwapIntervalEXT) { | 222 if (HasExtension("GLX_EXT_swap_control") && |
| 223 g_driver_glx.fn.glXSwapIntervalEXTFn) { |
| 223 glXSwapIntervalEXT( | 224 glXSwapIntervalEXT( |
| 224 display_, | 225 display_, |
| 225 glXGetCurrentDrawable(), | 226 glXGetCurrentDrawable(), |
| 226 interval); | 227 interval); |
| 227 } else if (HasExtension("GLX_MESA_swap_control") && glXSwapIntervalMESA) { | 228 } else if (HasExtension("GLX_MESA_swap_control") && |
| 229 g_driver_glx.fn.glXSwapIntervalMESAFn) { |
| 228 glXSwapIntervalMESA(interval); | 230 glXSwapIntervalMESA(interval); |
| 229 } else { | 231 } else { |
| 230 if(interval == 0) | 232 if(interval == 0) |
| 231 LOG(WARNING) << | 233 LOG(WARNING) << |
| 232 "Could not disable vsync: driver does not " | 234 "Could not disable vsync: driver does not " |
| 233 "support GLX_EXT_swap_control"; | 235 "support GLX_EXT_swap_control"; |
| 234 } | 236 } |
| 235 } | 237 } |
| 236 | 238 |
| 237 std::string GLContextGLX::GetExtensions() { | 239 std::string GLContextGLX::GetExtensions() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 258 | 260 |
| 259 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { | 261 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { |
| 260 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 262 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
| 261 } | 263 } |
| 262 | 264 |
| 263 GLContextGLX::~GLContextGLX() { | 265 GLContextGLX::~GLContextGLX() { |
| 264 Destroy(); | 266 Destroy(); |
| 265 } | 267 } |
| 266 | 268 |
| 267 } // namespace gfx | 269 } // namespace gfx |
| OLD | NEW |