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

Side by Side Diff: ui/compositor/layer_owner.cc

Issue 1800393002: RecreateLayer should copy the transform as well. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/compositor/layer_owner_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | ui/compositor/layer_owner_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698