| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/compositor/layer_owner.h" | 5 #include "ui/compositor/layer_owner.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ui/compositor/layer_owner_delegate.h" | 9 #include "ui/compositor/layer_owner_delegate.h" |
| 10 | 10 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 SetLayer(new_layer); | 42 SetLayer(new_layer); |
| 43 new_layer->SetVisible(old_layer->GetTargetVisibility()); | 43 new_layer->SetVisible(old_layer->GetTargetVisibility()); |
| 44 new_layer->SetOpacity(old_layer->GetTargetOpacity()); | 44 new_layer->SetOpacity(old_layer->GetTargetOpacity()); |
| 45 new_layer->SetBounds(layer_bounds); | 45 new_layer->SetBounds(layer_bounds); |
| 46 new_layer->SetMasksToBounds(old_layer->GetMasksToBounds()); | 46 new_layer->SetMasksToBounds(old_layer->GetMasksToBounds()); |
| 47 new_layer->set_name(old_layer->name()); | 47 new_layer->set_name(old_layer->name()); |
| 48 new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely()); | 48 new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely()); |
| 49 new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely()); | 49 new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely()); |
| 50 new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset()); | 50 new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset()); |
| 51 new_layer->SetLayerInverted(old_layer->layer_inverted()); | 51 new_layer->SetLayerInverted(old_layer->layer_inverted()); |
| 52 new_layer->SetTransform(old_layer->GetTargetTransform()); |
| 52 if (old_layer->type() == LAYER_SOLID_COLOR) | 53 if (old_layer->type() == LAYER_SOLID_COLOR) |
| 53 new_layer->SetColor(old_layer->GetTargetColor()); | 54 new_layer->SetColor(old_layer->GetTargetColor()); |
| 54 SkRegion* alpha_shape = old_layer->alpha_shape(); | 55 SkRegion* alpha_shape = old_layer->alpha_shape(); |
| 55 if (alpha_shape) | 56 if (alpha_shape) |
| 56 new_layer->SetAlphaShape(make_scoped_ptr(new SkRegion(*alpha_shape))); | 57 new_layer->SetAlphaShape(make_scoped_ptr(new SkRegion(*alpha_shape))); |
| 57 | 58 |
| 58 if (old_layer->parent()) { | 59 if (old_layer->parent()) { |
| 59 // Install new layer as a sibling of the old layer, stacked below it. | 60 // Install new layer as a sibling of the old layer, stacked below it. |
| 60 old_layer->parent()->Add(new_layer); | 61 old_layer->parent()->Add(new_layer); |
| 61 old_layer->parent()->StackBelow(new_layer, old_layer.get()); | 62 old_layer->parent()->StackBelow(new_layer, old_layer.get()); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 88 void LayerOwner::DestroyLayer() { | 89 void LayerOwner::DestroyLayer() { |
| 89 layer_ = NULL; | 90 layer_ = NULL; |
| 90 layer_owner_.reset(); | 91 layer_owner_.reset(); |
| 91 } | 92 } |
| 92 | 93 |
| 93 bool LayerOwner::OwnsLayer() const { | 94 bool LayerOwner::OwnsLayer() const { |
| 94 return !!layer_owner_; | 95 return !!layer_owner_; |
| 95 } | 96 } |
| 96 | 97 |
| 97 } // namespace ui | 98 } // namespace ui |
| OLD | NEW |