Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1337)

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 407433002: Don't drop all children when changing Android root layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 6232bcdb434467966c7e2ba5b0d99ad07063a930..47f037d17f4652d3c7e48c3539d9e1fdb4fc7bff 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) {

Powered by Google App Engine
This is Rietveld 408576698