Index: ui/gl/gl_implementation_x11.cc |
diff --git a/ui/gl/gl_implementation_x11.cc b/ui/gl/gl_implementation_x11.cc |
index 2da82547a097ed21f9fefc2967c020c1da8150a3..796752a9e4844f5434f9e1766d1570b4e59db86b 100644 |
--- a/ui/gl/gl_implementation_x11.cc |
+++ b/ui/gl/gl_implementation_x11.cc |
@@ -229,4 +229,43 @@ void ClearGLBindings() { |
UnloadGLNativeLibraries(); |
} |
+bool GetGLWindowSystemBindingInfo(GLWindowSystemBindingInfo* info) { |
+ *info = GLWindowSystemBindingInfo(); |
+ switch (GetGLImplementation()) { |
+ case kGLImplementationDesktopGL: { |
+ Display* display = glXGetCurrentDisplay(); |
+ const int kDefaultScreen = 0; |
+ const char* vendor = |
+ glXQueryServerString(display, kDefaultScreen, GLX_VENDOR); |
+ const char* version = |
+ glXQueryServerString(display, kDefaultScreen, GLX_VERSION); |
+ const char* extensions = |
+ glXQueryServerString(display, kDefaultScreen, GLX_EXTENSIONS); |
+ if (vendor) |
+ info->vendor = vendor; |
+ if (version) |
+ info->version = version; |
+ if (extensions) |
+ info->extensions = extensions; |
+ return true; |
+ } |
+ case kGLImplementationEGLGLES2: { |
+ EGLDisplay display = eglGetCurrentDisplay(); |
greggman
2013/05/23 16:22:14
This piece of code is repeated 3 times. Does it ma
|
+ const char* vendor = eglQueryString(display, EGL_VENDOR); |
+ const char* version = eglQueryString(display, EGL_VERSION); |
+ const char* extensions = eglQueryString(display, EGL_EXTENSIONS); |
+ if (vendor) |
+ info->vendor = vendor; |
+ if (version) |
+ info->version = version; |
+ if (extensions) |
+ info->extensions = extensions; |
+ return true; |
+ } |
+ default: |
+ return false; |
+ } |
+ return false; |
+} |
+ |
} // namespace gfx |