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

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

Issue 8060045: Use shared D3D9 texture to transport the compositor's backing buffer to the browser... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/gfx/gl/gl_surface.h
===================================================================
--- ui/gfx/gl/gl_surface.h (revision 106500)
+++ ui/gfx/gl/gl_surface.h (working copy)
@@ -31,6 +31,8 @@
// Destroys the surface.
virtual void Destroy() = 0;
+ virtual bool Resize(const gfx::Size& size);
+
// Returns true if this surface is offscreen.
virtual bool IsOffscreen() = 0;
@@ -54,8 +56,24 @@
// on error.
virtual bool OnMakeCurrent(GLContext* context);
+ // This gives a hint as to whether this surface is visible. If it is not
+ // visible, the backing store need not be preserved.
virtual void SetVisible(bool visible);
+ // Get a handle used to share the surface with another process. Returns null
+ // if this is not possible.
+ virtual void* GetShareHandle();
+
+ // Get the platform specific display on which this surface resides, if
+ // available.
+ virtual void* GetDisplay();
+
+ // Get the platfrom specific configuration for this surface, if available.
+ virtual void* GetConfig();
+
+ // Get the GL pixel format of the surface, if available.
+ virtual unsigned GetFormat();
+
// Create a GL surface that renders directly to a view.
static scoped_refptr<GLSurface> CreateViewGLSurface(
bool software,
@@ -78,6 +96,34 @@
DISALLOW_COPY_AND_ASSIGN(GLSurface);
};
+// Implementation of GLSurface that forwards all calls through to another
+// GLSurface.
+class GL_EXPORT GLSurfaceAdapter : public GLSurface {
+ public:
+ explicit GLSurfaceAdapter(GLSurface* surface);
+ virtual ~GLSurfaceAdapter();
+
+ virtual bool Initialize();
+ virtual void Destroy();
+ virtual bool Resize(const gfx::Size& size);
+ virtual bool IsOffscreen();
+ virtual bool SwapBuffers();
+ virtual gfx::Size GetSize();
+ virtual void* GetHandle();
+ virtual unsigned int GetBackingFrameBufferObject();
+ virtual bool OnMakeCurrent(GLContext* context);
+ virtual void* GetShareHandle();
+ virtual void* GetDisplay();
+ virtual void* GetConfig();
+ virtual unsigned GetFormat();
+
+ GLSurface* surface() const { return surface_.get(); }
+
+ private:
+ scoped_refptr<GLSurface> surface_;
+ DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter);
+};
+
} // namespace gfx
#endif // UI_GFX_GL_GL_SURFACE_H_
« gpu/DEPS ('K') | « ui/gfx/gl/gl_context_wgl.cc ('k') | ui/gfx/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698