Index: ui/gl/gl_context.h |
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h |
index dc65f64a8ae6baad9b6990ef104a46ba445b99d4..3eb390fce5cb03f4dcca9e43cc2eda7d12f35f93 100644 |
--- a/ui/gl/gl_context.h |
+++ b/ui/gl/gl_context.h |
@@ -88,6 +88,7 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
static bool LosesAllContextsOnContextLost(); |
+ // Returns the last GLContext made current, virtual or real. |
static GLContext* GetCurrent(); |
virtual bool WasAllocatedUsingRobustnessExtension(); |
@@ -107,16 +108,22 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
// Sets the GL api to the real hardware API (vs the VirtualAPI) |
static void SetRealGLApi(); |
- static void SetCurrent(GLContext* context, GLSurface* surface); |
+ 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(); |
+ // Returns the last real (non-virtual) GLContext made current. |
+ static GLContext* GetRealCurrent(); |
no sievers
2013/06/05 16:43:37
Acutally, can we do this now instead:
GLContext::
jonathan.backer
2013/06/05 20:40:11
This is fundamentally the same as IsVirtualContext
|
+ |
private: |
friend class base::RefCounted<GLContext>; |
+ // For GetRealCurrent. |
+ friend class VirtualGLApi; |
+ |
scoped_refptr<GLShareGroup> share_group_; |
scoped_ptr<VirtualGLApi> virtual_gl_api_; |
scoped_ptr<GLStateRestorer> state_restorer_; |
@@ -124,6 +131,19 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
DISALLOW_COPY_AND_ASSIGN(GLContext); |
}; |
+class GL_EXPORT GLContextReal : public GLContext { |
+ public: |
+ explicit GLContextReal(GLShareGroup* share_group); |
+ |
+ protected: |
+ virtual ~GLContextReal(); |
+ |
+ virtual void SetCurrent(GLSurface* surface) OVERRIDE; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(GLContextReal); |
+}; |
+ |
} // namespace gfx |
#endif // UI_GL_GL_CONTEXT_H_ |