diff options
author | mmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 15:04:39 +0000 |
---|---|---|
committer | mmocny@chromium.org <mmocny@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-22 15:04:39 +0000 |
commit | e1912900343026500db1192f6e9c05d43798a1df (patch) | |
tree | fb80c9fd8dcd31f59b7142e9092c3c89a3f22ef1 /content/common/gpu/texture_image_transport_surface.h | |
parent | 8a197f26faebaf68cb484596ccf970b1ab1fe779 (diff) | |
download | chromium_src-e1912900343026500db1192f6e9c05d43798a1df.zip chromium_src-e1912900343026500db1192f6e9c05d43798a1df.tar.gz chromium_src-e1912900343026500db1192f6e9c05d43798a1df.tar.bz2 |
Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer drop.
On Aura, every time a tab is backgrounded, RenderWidgetHostViewAura will reset its handle to the front surface. If that tab is foregrounded again, that front surface will not be used until synchronizing with the gpu process to make sure that surface is still available. By doing this, the gpu process knows when it is safe to discard the front surface.
RWHVA sends a FrontSurfaceIsProtected(bool, int) message to the gpu process to keep it informed about front surface protection. The int is a state-of-the-world identifier to protect from ABA issues. RWHVA delays sending FrontSurfaceIsProtected(false) until after the current surface is certain to not be in use, namely after the compositor finishes the current frame and the browser thumbnailer is complete.
BUG=112842
TEST=Manual
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=142408
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=142541
Review URL: https://chromiumcodereview.appspot.com/10052018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common/gpu/texture_image_transport_surface.h')
-rw-r--r-- | content/common/gpu/texture_image_transport_surface.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/content/common/gpu/texture_image_transport_surface.h b/content/common/gpu/texture_image_transport_surface.h index 730e9c2..f2a8fff 100644 --- a/content/common/gpu/texture_image_transport_surface.h +++ b/content/common/gpu/texture_image_transport_surface.h @@ -49,6 +49,9 @@ class TextureImageTransportSurface : virtual void OnBuffersSwappedACK() OVERRIDE; virtual void OnPostSubBufferACK() OVERRIDE; virtual void OnResizeViewACK() OVERRIDE; + virtual void OnSetFrontSurfaceIsProtected( + bool is_protected, + uint32 protection_state_id) OVERRIDE; virtual void OnResize(gfx::Size size) OVERRIDE; // GpuCommandBufferStub::DestructionObserver implementation. @@ -75,9 +78,11 @@ class TextureImageTransportSurface : virtual ~TextureImageTransportSurface(); void CreateBackTexture(const gfx::Size& size); - void ReleaseBackTexture(); void AttachBackTextureToFBO(); + void ReleaseTexture(int id); void ReleaseParentStub(); + void AdjustFrontBufferAllocation(); + int front() const { return front_; } int back() const { return 1 - front_; } // The framebuffer that represents this surface (service id). Allocated lazily @@ -98,6 +103,9 @@ class TextureImageTransportSurface : bool backbuffer_suggested_allocation_; bool frontbuffer_suggested_allocation_; + bool frontbuffer_is_protected_; + uint32 protection_state_id_; + scoped_ptr<ImageTransportHelper> helper_; gfx::GLSurfaceHandle handle_; GpuCommandBufferStub* parent_stub_; |