Commit 25950ad2 authored by aelias@chromium.org's avatar aelias@chromium.org

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284164 0039d316-1c4b-4281-b951-d872f2087c98
parent d690b7d3
......@@ -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) {
......
......@@ -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_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment