summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 18:58:53 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-23 18:58:53 +0000
commit9cdf03c946d934f12070c4272c87f902ae844d86 (patch)
treef8e359cc992aaa996fd130d00d7d42670b10af50
parentbdbdfca224e81f89fa8ae3783313615933d0a388 (diff)
downloadchromium_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.cc9
-rw-r--r--content/browser/renderer_host/compositor_impl_android.h4
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_;