Commit 1d1fa23c authored by jackhou's avatar jackhou Committed by Commit bot

[Ash] Copy alpha_shape when recreating layers.

Windows that have a shape applied via AppWindow.setShape lose
their shape after being minimized. This is because minimizing
invokes HidingWindowAnimationObserverBase::DetachAndRecreateLayers.

BUG=408737

Review URL: https://codereview.chromium.org/547283003

Cr-Commit-Position: refs/heads/master@{#294283}
parent e41575ab
...@@ -203,6 +203,7 @@ class COMPOSITOR_EXPORT Layer ...@@ -203,6 +203,7 @@ class COMPOSITOR_EXPORT Layer
void SetBackgroundZoom(float zoom, int inset); void SetBackgroundZoom(float zoom, int inset);
// Set the shape of this layer. // Set the shape of this layer.
SkRegion* alpha_shape() const { return alpha_shape_.get(); }
void SetAlphaShape(scoped_ptr<SkRegion> region); void SetAlphaShape(scoped_ptr<SkRegion> region);
// Invert the layer. // Invert the layer.
......
...@@ -46,6 +46,9 @@ scoped_ptr<Layer> LayerOwner::RecreateLayer() { ...@@ -46,6 +46,9 @@ scoped_ptr<Layer> LayerOwner::RecreateLayer() {
new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely()); new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely());
new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely()); new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely());
new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset()); new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset());
SkRegion* alpha_shape = old_layer->alpha_shape();
if (alpha_shape)
new_layer->SetAlphaShape(make_scoped_ptr(new SkRegion(*alpha_shape)));
// Install new layer as a sibling of the old layer, stacked below it. // Install new layer as a sibling of the old layer, stacked below it.
if (old_layer->parent()) { if (old_layer->parent()) {
......
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