| Index: ui/gfx/gl/gl_context.h
|
| ===================================================================
|
| --- ui/gfx/gl/gl_context.h (revision 85357)
|
| +++ 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 {
|
|
|
| @@ -25,40 +23,22 @@
|
| // 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 +49,10 @@
|
| // 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);
|
|
|
| static bool LosesAllContextsOnContextLost();
|
|
|
| - protected:
|
| - bool InitializeCommon();
|
| -
|
| private:
|
| DISALLOW_COPY_AND_ASSIGN(GLContext);
|
| };
|
|
|