summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_gl_api_implementation.h
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-16 04:52:36 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-16 04:52:36 +0000
commit95c9d11429b11171b41e28527dc8a915949016fc (patch)
tree8eff832c8335de65b827fd45ebdd99ee29cff5e2 /ui/gl/gl_gl_api_implementation.h
parent2db05555413d30171f24be6dd1a5ead44ca03cdf (diff)
downloadchromium_src-95c9d11429b11171b41e28527dc8a915949016fc.zip
chromium_src-95c9d11429b11171b41e28527dc8a915949016fc.tar.gz
chromium_src-95c9d11429b11171b41e28527dc8a915949016fc.tar.bz2
Make most of VirtualGL auto-generated
I'm not sure if this is the best way GLApi is a pure virtual interface GLApiBase is a class that calls driver->fnGLfunction so it can be shared with RealGLApi and VirtualGLApi RealGLApi is basically has nothing currenlty. It's just GLApiBase but I guess the point is you can override something if you need to VirtualGLApi can now override just what it needs to so adding new functions to generate_bindings.py no longer needs manual editing BUG=none R=apatrick@chromium.org Review URL: https://chromiumcodereview.appspot.com/11565005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173364 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gl/gl_gl_api_implementation.h')
-rw-r--r--ui/gl/gl_gl_api_implementation.h33
1 files changed, 18 insertions, 15 deletions
diff --git a/ui/gl/gl_gl_api_implementation.h b/ui/gl/gl_gl_api_implementation.h
index 4842194..8226f89 100644
--- a/ui/gl/gl_gl_api_implementation.h
+++ b/ui/gl/gl_gl_api_implementation.h
@@ -26,44 +26,47 @@ void ClearGLBindingsGL();
void SetGLToRealGLApi();
void SetGLApi(GLApi* api);
-// Implemenents the GL API by calling directly into the driver.
-class GL_EXPORT RealGLApi : public GLApi {
+class GL_EXPORT GLApiBase : public GLApi {
public:
- RealGLApi();
- virtual ~RealGLApi();
- void Initialize(DriverGL* driver);
-
// Include the auto-generated part of this class. We split this because
// it means we can easily edit the non-auto generated parts right here in
// this file instead of having to edit some template or the code generator.
#include "gl_bindings_api_autogen_gl.h"
- private:
+ protected:
+ GLApiBase();
+ virtual ~GLApiBase();
+ void InitializeBase(DriverGL* driver);
+
DriverGL* driver_;
};
+// Implemenents the GL API by calling directly into the driver.
+class GL_EXPORT RealGLApi : public GLApiBase {
+ public:
+ RealGLApi();
+ virtual ~RealGLApi();
+ void Initialize(DriverGL* driver);
+};
+
// Implementents the GL API using co-operative state restoring.
// Assumes there is only one real GL context and that multiple virtual contexts
// are implemented above it. Restores the needed state from the current context.
-class GL_EXPORT VirtualGLApi : public GLApi {
+class GL_EXPORT VirtualGLApi : public GLApiBase {
public:
VirtualGLApi();
virtual ~VirtualGLApi();
void Initialize(DriverGL* driver, GLContext* real_context);
- // Include the auto-generated part of this class. We split this because
- // it means we can easily edit the non-auto generated parts right here in
- // this file instead of having to edit some template or the code generator.
- #include "gl_bindings_api_autogen_gl.h"
-
// Sets the current virutal context.
bool MakeCurrent(GLContext* virtual_context, GLSurface* surface);
void OnDestroyVirtualContext(GLContext* virtual_context);
- private:
- DriverGL* driver_;
+ // Overridden functions from GLApiBase
+ virtual const GLubyte* glGetStringFn(GLenum name) OVERRIDE;
+ private:
// The real context we're running on.
GLContext* real_context_;