From 74b407d576a540dacfc1bc5564713ac8105eb2cf Mon Sep 17 00:00:00 2001 From: "mmocny@chromium.org" Date: Sat, 11 Feb 2012 01:13:55 +0000 Subject: Drop frontbuffers for hibernated tabs using image_transport_surface_win. BUG=112842 TEST=Manual Review URL: http://codereview.chromium.org/9317056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121598 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/gl/gl_surface.cc | 6 +++--- ui/gfx/gl/gl_surface.h | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'ui/gfx/gl') diff --git a/ui/gfx/gl/gl_surface.cc b/ui/gfx/gl/gl_surface.cc index 858fb93b..47f6d6a 100644 --- a/ui/gfx/gl/gl_surface.cc +++ b/ui/gfx/gl/gl_surface.cc @@ -107,7 +107,7 @@ bool GLSurface::OnMakeCurrent(GLContext* context) { return true; } -void GLSurface::SetVisible(bool visible) { +void GLSurface::SetVisibility(VisibilityState visibility_state) { } void* GLSurface::GetShareHandle() { @@ -188,8 +188,8 @@ bool GLSurfaceAdapter::OnMakeCurrent(GLContext* context) { return surface_->OnMakeCurrent(context); } -void GLSurfaceAdapter::SetVisible(bool visible) { - surface_->SetVisible(visible); +void GLSurfaceAdapter::SetVisibility(VisibilityState visibility_state) { + surface_->SetVisibility(visibility_state); } void* GLSurfaceAdapter::GetShareHandle() { diff --git a/ui/gfx/gl/gl_surface.h b/ui/gfx/gl/gl_surface.h index ca2b8df..c5c62cb 100644 --- a/ui/gfx/gl/gl_surface.h +++ b/ui/gfx/gl/gl_surface.h @@ -73,7 +73,12 @@ class GL_EXPORT GLSurface : public base::RefCounted { // 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); + enum VisibilityState { + VISIBILITY_STATE_FOREGROUND, + VISIBILITY_STATE_BACKGROUND, + VISIBILITY_STATE_HIBERNATED + }; + virtual void SetVisibility(VisibilityState visibility_state); // Get a handle used to share the surface with another process. Returns null // if this is not possible. @@ -130,7 +135,7 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface { virtual void* GetHandle() OVERRIDE; virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; - virtual void SetVisible(bool visible) OVERRIDE; + virtual void SetVisibility(VisibilityState visibility_state) OVERRIDE; virtual void* GetShareHandle() OVERRIDE; virtual void* GetDisplay() OVERRIDE; virtual void* GetConfig() OVERRIDE; -- cgit v1.1