Index: ui/gl/gl_context.h |
diff --git a/ui/gl/gl_context.h b/ui/gl/gl_context.h |
index f40b1bba78647ab9ef7090ffa420e4c5ba1b739c..2f05e1b98fd6b597a96f140fa65ae9cceafe7aef 100644 |
--- a/ui/gl/gl_context.h |
+++ b/ui/gl/gl_context.h |
@@ -117,6 +117,20 @@ class GL_EXPORT GLContext : public base::RefCounted<GLContext> { |
protected: |
virtual ~GLContext(); |
+ // Will release the given context and surface when going out of scope, |
+ // unless Release() is called. |
+ class ScopedReleaseCurrent { |
+ public: |
+ ScopedReleaseCurrent(GLContext* context, GLSurface* surface); |
+ ~ScopedReleaseCurrent(); |
+ |
+ void Release(); |
+ |
+ private: |
+ GLContext* context_; |
piman
2014/04/01 23:00:02
nit: scoped_refptr? (below too)
|
+ GLSurface* surface_; |
+ }; |
+ |
// Sets the GL api to the real hardware API (vs the VirtualAPI) |
static void SetRealGLApi(); |
virtual void SetCurrent(GLSurface* surface); |