Chromium Code Reviews| 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/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 void ClearGLBindings() { | 222 void ClearGLBindings() { |
| 223 ClearGLBindingsEGL(); | 223 ClearGLBindingsEGL(); |
| 224 ClearGLBindingsGL(); | 224 ClearGLBindingsGL(); |
| 225 ClearGLBindingsGLX(); | 225 ClearGLBindingsGLX(); |
| 226 ClearGLBindingsOSMESA(); | 226 ClearGLBindingsOSMESA(); |
| 227 SetGLImplementation(kGLImplementationNone); | 227 SetGLImplementation(kGLImplementationNone); |
| 228 | 228 |
| 229 UnloadGLNativeLibraries(); | 229 UnloadGLNativeLibraries(); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { | |
| 233 *info = GLWindowSystemBindingInfo(); | |
| 234 switch (GetGLImplementation()) { | |
| 235 case kGLImplementationDesktopGL: { | |
| 236 Display* display = glXGetCurrentDisplay(); | |
| 237 const int kDefaultScreen = 0; | |
| 238 const char* vendor = | |
| 239 glXQueryServerString(display, kDefaultScreen, GLX_VENDOR); | |
| 240 const char* version = | |
| 241 glXQueryServerString(display, kDefaultScreen, GLX_VERSION); | |
| 242 const char* extensions = | |
| 243 glXQueryServerString(display, kDefaultScreen, GLX_EXTENSIONS); | |
| 244 if (vendor) | |
| 245 info->vendor = vendor; | |
| 246 if (version) | |
| 247 info->version = version; | |
| 248 if (extensions) | |
| 249 info->extensions = extensions; | |
| 250 return true; | |
| 251 } | |
| 252 case kGLImplementationEGLGLES2: { | |
| 253 EGLDisplay display = eglGetCurrentDisplay(); | |
|
greggman
2013/05/23 16:22:14
This piece of code is repeated 3 times. Does it ma
| |
| 254 const char* vendor = eglQueryString(display, EGL_VENDOR); | |
| 255 const char* version = eglQueryString(display, EGL_VERSION); | |
| 256 const char* extensions = eglQueryString(display, EGL_EXTENSIONS); | |
| 257 if (vendor) | |
| 258 info->vendor = vendor; | |
| 259 if (version) | |
| 260 info->version = version; | |
| 261 if (extensions) | |
| 262 info->extensions = extensions; | |
| 263 return true; | |
| 264 } | |
| 265 default: | |
| 266 return false; | |
| 267 } | |
| 268 return false; | |
| 269 } | |
| 270 | |
| 232 } // namespace gfx | 271 } // namespace gfx |
| OLD | NEW |