diff options
author | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 18:58:53 +0000 |
---|---|---|
committer | aelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-23 18:58:53 +0000 |
commit | 9cdf03c946d934f12070c4272c87f902ae844d86 (patch) | |
tree | f8e359cc992aaa996fd130d00d7d42670b10af50 | |
parent | bdbdfca224e81f89fa8ae3783313615933d0a388 (diff) | |
download | chromium_src-9cdf03c946d934f12070c4272c87f902ae844d86.zip chromium_src-9cdf03c946d934f12070c4272c87f902ae844d86.tar.gz chromium_src-9cdf03c946d934f12070c4272c87f902ae844d86.tar.bz2 |
Merge 284164 "Don't drop all children when changing Android root..."
> Don't drop all children when changing Android root layer.
>
> Unlike when this method was originally written, there can now be a
> second child, a readback layer. If the root layer happens to change
> while a readback is active, it will never complete, hanging the
> rendering.
>
> NOTRY=true
> BUG=386337
>
> Review URL: https://codereview.chromium.org/407433002
TBR=aelias@chromium.org
Review URL: https://codereview.chromium.org/417733002
git-svn-id: svn://svn.chromium.org/chrome/branches/2062/src@285003 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | content/browser/renderer_host/compositor_impl_android.cc | 9 | ||||
-rw-r--r-- | content/browser/renderer_host/compositor_impl_android.h | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc index 6232bcd..47f037d 100644 --- a/content/browser/renderer_host/compositor_impl_android.cc +++ b/content/browser/renderer_host/compositor_impl_android.cc @@ -341,9 +341,14 @@ UIResourceProvider& CompositorImpl::GetUIResourceProvider() { } void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { - root_layer_->RemoveAllChildren(); - if (root_layer) + if (subroot_layer_) { + subroot_layer_->RemoveFromParent(); + subroot_layer_ = NULL; + } + if (root_layer) { + subroot_layer_ = root_layer; root_layer_->AddChild(root_layer); + } } void CompositorImpl::SetWindowSurface(ANativeWindow* window) { diff --git a/content/browser/renderer_host/compositor_impl_android.h b/content/browser/renderer_host/compositor_impl_android.h index e3cc42e..4792d90 100644 --- a/content/browser/renderer_host/compositor_impl_android.h +++ b/content/browser/renderer_host/compositor_impl_android.h @@ -132,7 +132,11 @@ class CONTENT_EXPORT CompositorImpl bool is_transient); void OnGpuChannelEstablished(); + // root_layer_ is the persistent internal root layer, while subroot_layer_ + // is the one attached by the compositor client. scoped_refptr<cc::Layer> root_layer_; + scoped_refptr<cc::Layer> subroot_layer_; + scoped_ptr<cc::LayerTreeHost> host_; content::UIResourceProviderImpl ui_resource_provider_; |