Index: ui/gl/gl_context.h |
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h |
index 27a1a786d2727340932ca03c59952c8709b9aa40..3648ba15664e46c071303d13f04234a8fc751a61 100644 |
--- a/ui/gl/gl_context.h |
+++ b/ui/gl/gl_context.h |
@@ -9,12 +9,15 @@ |
#include "base/basictypes.h" |
#include "base/memory/ref_counted.h" |
+#include "base/memory/scoped_ptr.h" |
#include "ui/gl/gl_share_group.h" |
#include "ui/gl/gpu_preference.h" |
namespace gfx { |
class GLSurface; |
+class VirtualGLApi; |
+class GLStateRestorer; |
// Encapsulates an OpenGL context, hiding platform specific management. |
class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
@@ -44,6 +47,9 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
// Get the underlying platform specific GL context "handle". |
virtual void* GetHandle() = 0; |
+ // Gets the GLStateRestore for the context. |
+ virtual GLStateRestorer* GetGLStateRestorer(); |
+ |
// Set swap interval. This context must be current. |
virtual void SetSwapInterval(int interval) = 0; |
@@ -75,8 +81,17 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
virtual bool WasAllocatedUsingRobustnessExtension(); |
+ // Use this context for virtualization. |
+ void SetupForVirtualization(); |
+ |
+ // Make this context current when used for context virtualization. |
+ bool MakeVirtuallyCurrent(GLContext* virutal_context, GLSurface* surface); |
+ |
protected: |
virtual ~GLContext(); |
+ |
+ // Sets the GL api to the real hardware API (vs the VirtualAPI) |
+ static void SetRealGLApi(); |
static void SetCurrent(GLContext* context, GLSurface* surface); |
// Initialize function pointers to extension functions in the GL |
@@ -88,6 +103,7 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
friend class base::RefCounted<GLContext>; |
scoped_refptr<GLShareGroup> share_group_; |
+ scoped_ptr<VirtualGLApi> virtual_gl_api_; |
DISALLOW_COPY_AND_ASSIGN(GLContext); |
}; |