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

Side by Side Diff: cc/layers/surface_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/surface_layer.cc ('k') | cc/layers/surface_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SURFACE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_SURFACE_LAYER_IMPL_H_
6 #define CC_LAYERS_SURFACE_LAYER_IMPL_H_ 6 #define CC_LAYERS_SURFACE_LAYER_IMPL_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/ptr_util.h"
10 #include "cc/base/cc_export.h" 12 #include "cc/base/cc_export.h"
11 #include "cc/layers/layer_impl.h" 13 #include "cc/layers/layer_impl.h"
12 #include "cc/surfaces/surface_id.h" 14 #include "cc/surfaces/surface_id.h"
13 15
14 namespace cc { 16 namespace cc {
15 17
16 class CC_EXPORT SurfaceLayerImpl : public LayerImpl { 18 class CC_EXPORT SurfaceLayerImpl : public LayerImpl {
17 public: 19 public:
18 static scoped_ptr<SurfaceLayerImpl> Create(LayerTreeImpl* tree_impl, int id) { 20 static std::unique_ptr<SurfaceLayerImpl> Create(LayerTreeImpl* tree_impl,
19 return make_scoped_ptr(new SurfaceLayerImpl(tree_impl, id)); 21 int id) {
22 return base::WrapUnique(new SurfaceLayerImpl(tree_impl, id));
20 } 23 }
21 ~SurfaceLayerImpl() override; 24 ~SurfaceLayerImpl() override;
22 25
23 void SetSurfaceId(SurfaceId surface_id); 26 void SetSurfaceId(SurfaceId surface_id);
24 void SetSurfaceScale(float scale); 27 void SetSurfaceScale(float scale);
25 void SetSurfaceSize(const gfx::Size& size); 28 void SetSurfaceSize(const gfx::Size& size);
26 SurfaceId surface_id() const { return surface_id_; } 29 SurfaceId surface_id() const { return surface_id_; }
27 30
28 // LayerImpl overrides. 31 // LayerImpl overrides.
29 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 32 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
30 void PushPropertiesTo(LayerImpl* layer) override; 33 void PushPropertiesTo(LayerImpl* layer) override;
31 void AppendQuads(RenderPass* render_pass, 34 void AppendQuads(RenderPass* render_pass,
32 AppendQuadsData* append_quads_data) override; 35 AppendQuadsData* append_quads_data) override;
33 36
34 protected: 37 protected:
35 SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id); 38 SurfaceLayerImpl(LayerTreeImpl* tree_impl, int id);
36 39
37 private: 40 private:
38 void GetDebugBorderProperties(SkColor* color, float* width) const override; 41 void GetDebugBorderProperties(SkColor* color, float* width) const override;
39 void AppendRainbowDebugBorder(RenderPass* render_pass); 42 void AppendRainbowDebugBorder(RenderPass* render_pass);
40 void AsValueInto(base::trace_event::TracedValue* dict) const override; 43 void AsValueInto(base::trace_event::TracedValue* dict) const override;
41 const char* LayerTypeAsString() const override; 44 const char* LayerTypeAsString() const override;
42 45
43 SurfaceId surface_id_; 46 SurfaceId surface_id_;
44 gfx::Size surface_size_; 47 gfx::Size surface_size_;
45 float surface_scale_; 48 float surface_scale_;
46 49
47 DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl); 50 DISALLOW_COPY_AND_ASSIGN(SurfaceLayerImpl);
48 }; 51 };
49 52
50 } // namespace cc 53 } // namespace cc
51 54
52 #endif // CC_LAYERS_SURFACE_LAYER_IMPL_H_ 55 #endif // CC_LAYERS_SURFACE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/surface_layer.cc ('k') | cc/layers/surface_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698