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

Unified Diff: ui/gl/gl_context.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: Nix unnecessary changes. 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
« no previous file with comments | « no previous file | ui/gl/gl_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
+
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_
« no previous file with comments | « no previous file | ui/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698