Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(587)

Unified Diff: ui/gl/gl_context.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Improve Windows initialization and renderBufferMultisample explanation Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_context.h ('k') | ui/gl/gl_context_cgl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ui/gl/gl_context.h ('k') | ui/gl/gl_context_cgl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698