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

Unified Diff: ui/gl/gl_context.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.gyp ('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 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);
};
« no previous file with comments | « ui/gl/gl.gyp ('k') | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698