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

Unified Diff: ui/gl/gl_context.h

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_bindings.h ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_context.h
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h
index 3eb390fce5cb03f4dcca9e43cc2eda7d12f35f93..66a763167ba67ca2e505a100b4b863aa0b94b04c 100644
--- a/ui/gl/gl_context.h
+++ b/ui/gl/gl_context.h
@@ -18,6 +18,7 @@ namespace gfx {
class GLSurface;
class VirtualGLApi;
+struct GLVersionInfo;
// Encapsulates an OpenGL context, hiding platform specific management.
class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
@@ -76,6 +77,10 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
// context must be current.
bool HasExtension(const char* name);
+ // Returns version info of the underlying GL context. The context must be
+ // current.
+ const GLVersionInfo* GetVersionInfo();
+
GLShareGroup* share_group();
// Create a GL context that is compatible with the given surface.
@@ -110,14 +115,17 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
static void SetRealGLApi();
virtual void SetCurrent(GLSurface* surface);
- // Initialize function pointers to extension functions in the GL
- // implementation. Should be called immediately after this context is made
- // current.
- bool InitializeExtensionBindings();
+ // Initialize function pointers to functions where the bound version depends
+ // on GL version or supported extensions. Should be called immediately after
+ // this context is made current.
+ bool InitializeDynamicBindings();
// Returns the last real (non-virtual) GLContext made current.
static GLContext* GetRealCurrent();
+ // Returns the GL version string. The context must be current.
+ virtual std::string GetGLVersion();
+
private:
friend class base::RefCounted<GLContext>;
@@ -127,6 +135,7 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> {
scoped_refptr<GLShareGroup> share_group_;
scoped_ptr<VirtualGLApi> virtual_gl_api_;
scoped_ptr<GLStateRestorer> state_restorer_;
+ scoped_ptr<GLVersionInfo> version_info_;
DISALLOW_COPY_AND_ASSIGN(GLContext);
};
« no previous file with comments | « ui/gl/gl_bindings.h ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698