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 <vector> | 5 #include <vector> |
6 | 6 |
7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 | 267 |
268 void ClearGLBindings() { | 268 void ClearGLBindings() { |
269 ClearGLBindingsEGL(); | 269 ClearGLBindingsEGL(); |
270 ClearGLBindingsGL(); | 270 ClearGLBindingsGL(); |
271 ClearGLBindingsOSMESA(); | 271 ClearGLBindingsOSMESA(); |
272 ClearGLBindingsWGL(); | 272 ClearGLBindingsWGL(); |
273 SetGLImplementation(kGLImplementationNone); | 273 SetGLImplementation(kGLImplementationNone); |
274 UnloadGLNativeLibraries(); | 274 UnloadGLNativeLibraries(); |
275 } | 275 } |
276 | 276 |
| 277 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
| 278 *info = GLWindowSystemBindingInfo(); |
| 279 switch (GetGLImplementation()) { |
| 280 case kGLImplementationDesktopGL: { |
| 281 if (!wglGetExtensionsStringEXT) |
| 282 return false; |
| 283 const char* extensions = wglGetExtensionsStringEXT(); |
| 284 if (extensions) |
| 285 info->extensions = extensions; |
| 286 return true; |
| 287 } |
| 288 case kGLImplementationEGLGLES2: { |
| 289 EGLDisplay display = eglGetCurrentDisplay(); |
| 290 const char* vendor = eglQueryString(display, EGL_VENDOR); |
| 291 const char* version = eglQueryString(display, EGL_VERSION); |
| 292 const char* extensions = eglQueryString(display, EGL_EXTENSIONS); |
| 293 if (vendor) |
| 294 info->vendor = vendor; |
| 295 if (version) |
| 296 info->version = version; |
| 297 if (extensions) |
| 298 info->extensions = extensions; |
| 299 return true; |
| 300 } |
| 301 default: |
| 302 return false; |
| 303 } |
| 304 return false; |
| 305 } |
| 306 |
277 } // namespace gfx | 307 } // namespace gfx |
OLD | NEW |