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

Unified Diff: ui/gl/gl_surface.h

Issue 15928002: GPU: Keep track of the last real context and real surface made current. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix OSX Created 7 years, 6 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_surface.h
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index a8825a58c5a4a1af229047342862c6f746b9fe7a..7ecfed30dcc4af689a5fe6bd6169e1ce5a59176e 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -16,6 +16,8 @@
namespace gfx {
class GLContext;
+class GLContextReal;
+class VirtualGLApi;
class VSyncProvider;
// Encapsulates a surface that can be rendered to with GL, hiding platform
@@ -107,19 +109,30 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
bool software,
const gfx::Size& size);
+ // Returns the last GLSurface made current, virtual or real.
static GLSurface* GetCurrent();
protected:
virtual ~GLSurface();
static bool InitializeOneOffInternal();
static void SetCurrent(GLSurface* surface);
+ static void SetRealCurrent(GLSurface* surface);
static bool ExtensionsContain(const char* extensions, const char* name);
+ // Returns the last GLSurface made current with a real (non-virtual) context.
+ static GLSurface* GetRealCurrent();
no sievers 2013/06/05 16:43:37 ...and do we then really need to track this separa
jonathan.backer 2013/06/05 20:40:11 Nope. I think that the DCHECK in gl_gl_api_impleme
+
private:
friend class base::RefCounted<GLSurface>;
friend class GLContext;
+ // For GetRealCurrent.
+ friend class VirtualGLApi;
+
+ // For SetRealCurrent.
+ friend class GLContextReal;
+
DISALLOW_COPY_AND_ASSIGN(GLSurface);
};

Powered by Google App Engine
This is Rietveld 408576698