Keep track of the current per-thread context and surface. Add
ScopedMakeCurrent to make it easier to briefly make another context
current. Use it in AcceleratedSurface implementation and verify in the
caller that it is working.
This infrastructure would have made it possible to catch
http://crbug.com/95492 and similar bugs where the wrong context was
current.
BUG=95962
TEST=ran CSS 3D example poster-circle; no assertion failures
Review URL: http://codereview.chromium.org/7787022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100528 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/gl/gl_context.h b/ui/gfx/gl/gl_context.h
index 5340ada..0a617f4 100644
--- a/ui/gfx/gl/gl_context.h
+++ b/ui/gfx/gl/gl_context.h
@@ -64,10 +64,13 @@
static bool LosesAllContextsOnContextLost();
+ static GLContext* GetCurrent();
+
virtual bool WasAllocatedUsingARBRobustness();
protected:
virtual ~GLContext();
+ static void SetCurrent(GLContext* context, GLSurface* surface);
private:
scoped_refptr<GLShareGroup> share_group_;