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

Unified Diff: ui/gl/gl_gl_api_implementation.h

Issue 11275120: Virtual GL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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_egl_api_implementation.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.h
diff --git a/ui/gl/gl_gl_api_implementation.h b/ui/gl/gl_gl_api_implementation.h
index 5c70b38cc4e4c16d1156afc35d198352c9a70aee..5051bf31b860b68382bdfc1aa2d4c3703174e8a0 100644
--- a/ui/gl/gl_gl_api_implementation.h
+++ b/ui/gl/gl_gl_api_implementation.h
@@ -9,18 +9,28 @@
#include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_export.h"
+namespace gpu {
+namespace gles2 {
+class GLES2Decoder;
+}
+}
namespace gfx {
class GLContext;
+class GLSurface;
void InitializeGLBindingsGL();
void InitializeGLExtensionBindingsGL(GLContext* context);
void InitializeDebugGLBindingsGL();
void ClearGLBindingsGL();
+void SetGLToRealGLApi();
+void SetGLApi(GLApi* api);
+// Implemenents the GL API by calling directly into the driver.
class GL_EXPORT RealGLApi : public GLApi {
public:
RealGLApi();
+ virtual ~RealGLApi();
void Initialize(DriverGL* driver);
// Include the auto-generated part of this class. We split this because
@@ -32,6 +42,36 @@ class GL_EXPORT RealGLApi : public GLApi {
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 {
+ 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);
+
+ private:
+ DriverGL* driver_;
+
+ // The real context we're running on.
+ GLContext* real_context_;
+
+ // The current virtual context.
+ GLContext* current_context_;
+
+ // The current surface.
+ GLSurface* current_surface_;
+};
+
} // namespace gfx
#endif // UI_GL_GL_API_IMPLEMENTATION_H_
« no previous file with comments | « ui/gl/gl_egl_api_implementation.cc ('k') | ui/gl/gl_gl_api_implementation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698