Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index 737a26103dbbf4b3a9eda03a8682d823da76c29a..57c055b7fea3576c25ab680009ad6efe46a4f9c6 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -247,13 +247,13 @@ void Layer::AddChild(scoped_refptr<Layer> child) { |
void Layer::InsertChild(scoped_refptr<Layer> child, size_t index) { |
DCHECK(IsPropertyChangeAllowed()); |
child->RemoveFromParent(); |
+ AddDrawableDescendants(child->NumDescendantsThatDrawContent() + |
+ (child->DrawsContent() ? 1 : 0)); |
child->SetParent(this); |
child->stacking_order_changed_ = true; |
index = std::min(index, children_.size()); |
children_.insert(children_.begin() + index, child); |
- AddDrawableDescendants(child->NumDescendantsThatDrawContent() + |
- (child->DrawsContent() ? 1 : 0)); |
SetNeedsFullTreeSync(); |
} |