Index: ui/gl/gl_context.cc |
diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc |
index 1bc4d122d1c4c74973aefa428947c851c7ef2b3f..dc3a3e8c21e0323b0c68061c6b4a592f63eb3fd3 100644 |
--- a/ui/gl/gl_context.cc |
+++ b/ui/gl/gl_context.cc |
@@ -14,6 +14,7 @@ |
#include "ui/gl/gl_implementation.h" |
#include "ui/gl/gl_surface.h" |
#include "ui/gl/gl_switches.h" |
+#include "ui/gl/gl_version_info.h" |
namespace gfx { |
@@ -58,6 +59,13 @@ std::string GLContext::GetExtensions() { |
return std::string(ext ? ext : ""); |
} |
+std::string GLContext::GetGLVersion() { |
+ DCHECK(IsCurrent(NULL)); |
+ const char *version = |
+ reinterpret_cast<const char*>(glGetString(GL_VERSION)); |
+ return std::string(version ? version : ""); |
+} |
+ |
bool GLContext::HasExtension(const char* name) { |
std::string extensions = GetExtensions(); |
extensions += " "; |
@@ -68,6 +76,15 @@ bool GLContext::HasExtension(const char* name) { |
return extensions.find(delimited_name) != std::string::npos; |
} |
+const GLVersionInfo* GLContext::GetVersionInfo() { |
+ if(!version_info_) { |
+ std::string version = GetGLVersion(); |
+ version_info_ = scoped_ptr<GLVersionInfo>( |
+ new GLVersionInfo(version.c_str())); |
+ } |
+ return version_info_.get(); |
+} |
+ |
GLShareGroup* GLContext::share_group() { |
return share_group_.get(); |
} |
@@ -114,14 +131,14 @@ bool GLContext::WasAllocatedUsingRobustnessExtension() { |
return false; |
} |
-bool GLContext::InitializeExtensionBindings() { |
+bool GLContext::InitializeDynamicBindings() { |
DCHECK(IsCurrent(NULL)); |
static bool initialized = false; |
if (initialized) |
return initialized; |
- initialized = InitializeGLExtensionBindings(GetGLImplementation(), this); |
+ initialized = InitializeDynamicGLBindings(GetGLImplementation(), this); |
if (!initialized) |
- LOG(ERROR) << "Could not initialize extension bindings."; |
+ LOG(ERROR) << "Could not initialize dynamic bindings."; |
return initialized; |
} |