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

Unified Diff: ui/gl/gl_context.h

Issue 221433004: gpu: Bind dummy GL API when no context is current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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
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);

Powered by Google App Engine
This is Rietveld 408576698