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

Side by Side Diff: cc/layers/nine_patch_layer_impl.h

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase Created 4 years, 8 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 | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/nine_patch_layer_impl.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
6 #define CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_ 6 #define CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h"
11 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
12 #include "cc/layers/layer_impl.h" 13 #include "cc/layers/layer_impl.h"
13 #include "cc/layers/ui_resource_layer_impl.h" 14 #include "cc/layers/ui_resource_layer_impl.h"
14 #include "cc/resources/resource_provider.h" 15 #include "cc/resources/resource_provider.h"
15 #include "cc/resources/ui_resource_client.h" 16 #include "cc/resources/ui_resource_client.h"
16 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
17 #include "ui/gfx/geometry/size.h" 18 #include "ui/gfx/geometry/size.h"
18 19
19 namespace base { 20 namespace base {
20 class DictionaryValue; 21 class DictionaryValue;
21 } 22 }
22 23
23 namespace cc { 24 namespace cc {
24 25
25 class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl { 26 class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
26 public: 27 public:
27 static scoped_ptr<NinePatchLayerImpl> Create(LayerTreeImpl* tree_impl, 28 static std::unique_ptr<NinePatchLayerImpl> Create(LayerTreeImpl* tree_impl,
28 int id) { 29 int id) {
29 return make_scoped_ptr(new NinePatchLayerImpl(tree_impl, id)); 30 return base::WrapUnique(new NinePatchLayerImpl(tree_impl, id));
30 } 31 }
31 ~NinePatchLayerImpl() override; 32 ~NinePatchLayerImpl() override;
32 33
33 // The bitmap stretches out the bounds of the layer. The following picture 34 // The bitmap stretches out the bounds of the layer. The following picture
34 // illustrates the parameters associated with the dimensions. 35 // illustrates the parameters associated with the dimensions.
35 // 36 //
36 // Layer space layout Bitmap space layout 37 // Layer space layout Bitmap space layout
37 // 38 //
38 // ------------------------ ~~~~~~~~~~ W ~~~~~~~~~~ 39 // ------------------------ ~~~~~~~~~~ W ~~~~~~~~~~
39 // | : | : : | 40 // | : | : : |
(...skipping 12 matching lines...) Expand all
52 // 53 //
53 // |image_bounds| = (W, H) 54 // |image_bounds| = (W, H)
54 // |image_aperture| = (X, Y, P, Q) 55 // |image_aperture| = (X, Y, P, Q)
55 // |border| = (A, C, A + B, C + D) 56 // |border| = (A, C, A + B, C + D)
56 // |fill_center| indicates whether to draw the center quad or not. 57 // |fill_center| indicates whether to draw the center quad or not.
57 void SetLayout(const gfx::Rect& image_aperture, 58 void SetLayout(const gfx::Rect& image_aperture,
58 const gfx::Rect& border, 59 const gfx::Rect& border,
59 bool fill_center, 60 bool fill_center,
60 bool nearest_neighbor); 61 bool nearest_neighbor);
61 62
62 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 63 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
63 void PushPropertiesTo(LayerImpl* layer) override; 64 void PushPropertiesTo(LayerImpl* layer) override;
64 65
65 void AppendQuads(RenderPass* render_pass, 66 void AppendQuads(RenderPass* render_pass,
66 AppendQuadsData* append_quads_data) override; 67 AppendQuadsData* append_quads_data) override;
67 68
68 base::DictionaryValue* LayerTreeAsJson() const override; 69 base::DictionaryValue* LayerTreeAsJson() const override;
69 70
70 protected: 71 protected:
71 NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id); 72 NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id);
72 73
(...skipping 12 matching lines...) Expand all
85 bool fill_center_; 86 bool fill_center_;
86 87
87 bool nearest_neighbor_; 88 bool nearest_neighbor_;
88 89
89 DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl); 90 DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl);
90 }; 91 };
91 92
92 } // namespace cc 93 } // namespace cc
93 94
94 #endif // CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_ 95 #endif // CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698