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

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

Issue 2259753003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ui/base/nine_image_painter_factory.cc ('k') | ui/compositor/test/in_process_context_factory.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 "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "ui/compositor/layer_owner_delegate.h" 10 #include "ui/compositor/layer_owner_delegate.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 new_layer->set_name(old_layer->name()); 48 new_layer->set_name(old_layer->name());
49 new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely()); 49 new_layer->SetFillsBoundsOpaquely(old_layer->fills_bounds_opaquely());
50 new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely()); 50 new_layer->SetFillsBoundsCompletely(old_layer->FillsBoundsCompletely());
51 new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset()); 51 new_layer->SetSubpixelPositionOffset(old_layer->subpixel_position_offset());
52 new_layer->SetLayerInverted(old_layer->layer_inverted()); 52 new_layer->SetLayerInverted(old_layer->layer_inverted());
53 new_layer->SetTransform(old_layer->GetTargetTransform()); 53 new_layer->SetTransform(old_layer->GetTargetTransform());
54 if (old_layer->type() == LAYER_SOLID_COLOR) 54 if (old_layer->type() == LAYER_SOLID_COLOR)
55 new_layer->SetColor(old_layer->GetTargetColor()); 55 new_layer->SetColor(old_layer->GetTargetColor());
56 SkRegion* alpha_shape = old_layer->alpha_shape(); 56 SkRegion* alpha_shape = old_layer->alpha_shape();
57 if (alpha_shape) 57 if (alpha_shape)
58 new_layer->SetAlphaShape(base::WrapUnique(new SkRegion(*alpha_shape))); 58 new_layer->SetAlphaShape(base::MakeUnique<SkRegion>(*alpha_shape));
59 59
60 if (old_layer->parent()) { 60 if (old_layer->parent()) {
61 // Install new layer as a sibling of the old layer, stacked below it. 61 // Install new layer as a sibling of the old layer, stacked below it.
62 old_layer->parent()->Add(new_layer); 62 old_layer->parent()->Add(new_layer);
63 old_layer->parent()->StackBelow(new_layer, old_layer.get()); 63 old_layer->parent()->StackBelow(new_layer, old_layer.get());
64 } else if (old_layer->GetCompositor()) { 64 } else if (old_layer->GetCompositor()) {
65 // If old_layer was the layer tree root then we need to move the Compositor 65 // If old_layer was the layer tree root then we need to move the Compositor
66 // over to the new root. 66 // over to the new root.
67 old_layer->GetCompositor()->SetRootLayer(new_layer); 67 old_layer->GetCompositor()->SetRootLayer(new_layer);
68 } 68 }
(...skipping 21 matching lines...) Expand all
90 void LayerOwner::DestroyLayer() { 90 void LayerOwner::DestroyLayer() {
91 layer_ = NULL; 91 layer_ = NULL;
92 layer_owner_.reset(); 92 layer_owner_.reset();
93 } 93 }
94 94
95 bool LayerOwner::OwnsLayer() const { 95 bool LayerOwner::OwnsLayer() const {
96 return !!layer_owner_; 96 return !!layer_owner_;
97 } 97 }
98 98
99 } // namespace ui 99 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/nine_image_painter_factory.cc ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698