| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 std::string GLContextGLX::GetExtensions() { | 237 std::string GLContextGLX::GetExtensions() { |
| 238 DCHECK(IsCurrent(NULL)); | 238 DCHECK(IsCurrent(NULL)); |
| 239 const char* extensions = GLSurfaceGLX::GetGLXExtensions(); | 239 const char* extensions = GLSurfaceGLX::GetGLXExtensions(); |
| 240 if (extensions) { | 240 if (extensions) { |
| 241 return GLContext::GetExtensions() + " " + extensions; | 241 return GLContext::GetExtensions() + " " + extensions; |
| 242 } | 242 } |
| 243 | 243 |
| 244 return GLContext::GetExtensions(); | 244 return GLContext::GetExtensions(); |
| 245 } | 245 } |
| 246 | 246 |
| 247 bool GLContextGLX::GetTotalGpuMemory(size_t& bytes) { |
| 248 bytes = 0; |
| 249 if (HasExtension("GL_NVX_gpu_memory_info")) { |
| 250 GLint kbytes = 0; |
| 251 glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &kbytes); |
| 252 bytes = 1024*kbytes; |
| 253 return true; |
| 254 } |
| 255 return false; |
| 256 } |
| 257 |
| 247 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { | 258 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { |
| 248 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 259 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
| 249 } | 260 } |
| 250 | 261 |
| 251 GLContextGLX::~GLContextGLX() { | 262 GLContextGLX::~GLContextGLX() { |
| 252 Destroy(); | 263 Destroy(); |
| 253 } | 264 } |
| 254 | 265 |
| 255 } // namespace gfx | 266 } // namespace gfx |
| OLD | NEW |