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

Unified Diff: ui/gfx/gl/gl_context.h

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 | « ui/gfx/compositor/compositor_gl.cc ('k') | ui/gfx/gl/gl_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_context.h
===================================================================
--- ui/gfx/gl/gl_context.h (revision 86168)
+++ ui/gfx/gl/gl_context.h (working copy)
@@ -8,9 +8,7 @@
#include <string>
-#include "build/build_config.h"
-#include "ui/gfx/native_widget_types.h"
-#include "ui/gfx/size.h"
+#include "base/basictypes.h"
namespace gfx {
@@ -22,43 +20,30 @@
GLContext() {}
virtual ~GLContext() {}
+ // Initializes the GL context to be compatible with the given surface. The GL
+ // context can be made with other surface's of the same type.
+ virtual bool Initialize(GLContext* shared_context,
+ GLSurface* compatible_surface) = 0;
Alexey Marinichev 2011/05/23 18:19:12 compatible_surface is used only by linux and osmes
+
// Destroys the GL context.
virtual void Destroy() = 0;
- // Makes the GL context current on the current thread.
- virtual bool MakeCurrent() = 0;
+ // Makes the GL context and a surface current on the current thread.
+ virtual bool MakeCurrent(GLSurface* surface) = 0;
- // Releases this GL context as current on the current thread. TODO(apatrick):
- // implement this in the other GLContexts.
- virtual void ReleaseCurrent();
+ // Releases this GL context and surface as current on the current thread.
+ virtual void ReleaseCurrent(GLSurface* surface) = 0;
- // Returns true if this context is current.
- virtual bool IsCurrent() = 0;
+ // Returns true if this context and surface is current. Pass a null surface
+ // if the current surface is not important.
+ virtual bool IsCurrent(GLSurface* surface) = 0;
- // Returns true if this context is offscreen.
- virtual bool IsOffscreen() = 0;
-
- // Swaps front and back buffers. This has no effect for off-screen
- // contexts.
- virtual bool SwapBuffers() = 0;
-
- // Get the size of the back buffer.
- virtual gfx::Size GetSize() = 0;
-
- // Get the surface. TODO(apatrick): remove this when contexts are split from
- // surfaces.
- virtual GLSurface* GetSurface();
-
// Get the underlying platform specific GL context "handle".
virtual void* GetHandle() = 0;
// Set swap interval. This context must be current.
virtual void SetSwapInterval(int interval) = 0;
- // Returns the internal frame buffer object name if the context is backed by
- // FBO. Otherwise returns 0.
- virtual unsigned int GetBackingFrameBufferObject();
-
// Returns space separated list of extensions. The context must be current.
virtual std::string GetExtensions();
@@ -69,17 +54,11 @@
// Create a GL context that is compatible with the given surface.
// |share_context|, if non-NULL, is a context which the
// internally created OpenGL context shares textures and other resources.
- // TODO(apatrick): For the time being, the context will take ownership of the
- // surface and the surface will be made the current read and draw surface
- // when the context is made current.
- static GLContext* CreateGLContext(GLSurface* compatible_surface,
- GLContext* shared_context);
+ static GLContext* CreateGLContext(GLContext* shared_context,
+ GLSurface* compatible_surface);
static bool LosesAllContextsOnContextLost();
- protected:
- bool InitializeCommon();
-
private:
DISALLOW_COPY_AND_ASSIGN(GLContext);
};
« no previous file with comments | « ui/gfx/compositor/compositor_gl.cc ('k') | ui/gfx/gl/gl_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698