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

Unified Diff: ui/compositor/layer_owner.cc

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Rebase Created 4 years, 2 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: ui/compositor/layer_owner.cc
diff --git a/ui/compositor/layer_owner.cc b/ui/compositor/layer_owner.cc
index d94ff2cc8239813e500d1296b780ae5cd16cff9d..9989f5db50511a342bd8870b520f3936ade61f6a 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 = old_layer->Clone().release();
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.

Powered by Google App Engine
This is Rietveld 408576698