diff options
author | powei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 01:59:08 +0000 |
---|---|---|
committer | powei@chromium.org <powei@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-20 01:59:08 +0000 |
commit | 862e8e1930af7ca13d9c1f1e5e4383a497209456 (patch) | |
tree | 338cd6b26e6db92c578771078b90e0f7d249a698 /content/common | |
parent | 0345ae045627c29766fb0d921a5301dfc95796c0 (diff) | |
download | chromium_src-862e8e1930af7ca13d9c1f1e5e4383a497209456.zip chromium_src-862e8e1930af7ca13d9c1f1e5e4383a497209456.tar.gz chromium_src-862e8e1930af7ca13d9c1f1e5e4383a497209456.tar.bz2 |
android: add resource state machine to RenderWidgetHostViewAndroid
We need to ensure freeing resources via AcceleratedSurfaceRelease() does not
compete with async readback and rapid switching between Hide() and Show(). This
change adds a state machine for to abstract out the case handling logic.
Also added public API functions LockResources() and UnlockResources(), which
are intended for future async readback uses.
BUG=326363
Review URL: https://codereview.chromium.org/114543002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242010 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/common')
-rw-r--r-- | content/common/gpu/image_transport_surface_android.cc | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/content/common/gpu/image_transport_surface_android.cc b/content/common/gpu/image_transport_surface_android.cc index 5f45469..7e12bda 100644 --- a/content/common/gpu/image_transport_surface_android.cc +++ b/content/common/gpu/image_transport_surface_android.cc @@ -44,7 +44,6 @@ class ImageTransportSurfaceAndroid virtual bool SwapBuffers() OVERRIDE; virtual std::string GetExtensions() OVERRIDE; virtual bool OnMakeCurrent(gfx::GLContext* context) OVERRIDE; - virtual void SetFrontbufferAllocation(bool allocated) OVERRIDE; virtual void WakeUpGpu() OVERRIDE; protected: @@ -55,7 +54,6 @@ class ImageTransportSurfaceAndroid void DoWakeUpGpu(); uint32 parent_client_id_; - bool frontbuffer_suggested_allocation_; base::TimeTicks begin_wake_up_time_; }; @@ -82,8 +80,7 @@ ImageTransportSurfaceAndroid::ImageTransportSurfaceAndroid( gfx::GLSurface* surface, uint32 parent_client_id) : PassThroughImageTransportSurface(manager, stub, surface, true), - parent_client_id_(parent_client_id), - frontbuffer_suggested_allocation_(true) {} + parent_client_id_(parent_client_id) {} ImageTransportSurfaceAndroid::~ImageTransportSurfaceAndroid() {} @@ -112,15 +109,6 @@ std::string ImageTransportSurfaceAndroid::GetExtensions() { return extensions; } -void ImageTransportSurfaceAndroid::SetFrontbufferAllocation(bool allocation) { - if (frontbuffer_suggested_allocation_ == allocation) - return; - frontbuffer_suggested_allocation_ = allocation; - // TODO(sievers): This races with CompositorFrame messages. - if (!allocation) - GetHelper()->SendAcceleratedSurfaceRelease(); -} - bool ImageTransportSurfaceAndroid::OnMakeCurrent(gfx::GLContext* context) { DidAccessGpu(); return PassThroughImageTransportSurface::OnMakeCurrent(context); |