Index: ui/compositor/layer_owner.cc |
diff --git a/ui/compositor/layer_owner.cc b/ui/compositor/layer_owner.cc |
index d94ff2cc8239813e500d1296b780ae5cd16cff9d..d36bfc15d2284e8325da9803589b637495148a94 100644 |
--- a/ui/compositor/layer_owner.cc |
+++ b/ui/compositor/layer_owner.cc |
@@ -38,24 +38,8 @@ std::unique_ptr<Layer> LayerOwner::RecreateLayer() { |
LayerDelegate* old_delegate = old_layer->delegate(); |
old_layer->set_delegate(NULL); |
- const gfx::Rect layer_bounds(old_layer->bounds()); |
- Layer* new_layer = new ui::Layer(old_layer->type()); |
+ Layer* new_layer = new ui::Layer(*old_layer); |
SetLayer(new_layer); |
- new_layer->SetVisible(old_layer->GetTargetVisibility()); |
- new_layer->SetOpacity(old_layer->GetTargetOpacity()); |
- new_layer->SetBounds(layer_bounds); |
- new_layer->SetMasksToBounds(old_layer->GetMasksToBounds()); |
- new_layer->set_name(old_layer->name()); |
- new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely()); |
- new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely()); |
- new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset()); |
- new_layer->SetLayerInverted(old_layer->layer_inverted()); |
- new_layer->SetTransform(old_layer->GetTargetTransform()); |
- if (old_layer->type() == LAYER_SOLID_COLOR) |
- new_layer->SetColor(old_layer->GetTargetColor()); |
- SkRegion* alpha_shape = old_layer->alpha_shape(); |
- if (alpha_shape) |
- new_layer->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape)); |
if (old_layer->parent()) { |
// Install new layer as a sibling of the old layer, stacked below it. |