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

Side by Side Diff: cc/layers/ui_resource_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/ui_resource_layer.cc ('k') | cc/layers/ui_resource_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_UI_RESOURCE_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_UI_RESOURCE_LAYER_IMPL_H_
6 #define CC_LAYERS_UI_RESOURCE_LAYER_IMPL_H_ 6 #define CC_LAYERS_UI_RESOURCE_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/resources/resource_provider.h" 14 #include "cc/resources/resource_provider.h"
14 #include "cc/resources/ui_resource_client.h" 15 #include "cc/resources/ui_resource_client.h"
15 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
17 18
18 namespace base { 19 namespace base {
19 class DictionaryValue; 20 class DictionaryValue;
20 } 21 }
21 22
22 namespace cc { 23 namespace cc {
23 24
24 class CC_EXPORT UIResourceLayerImpl : public LayerImpl { 25 class CC_EXPORT UIResourceLayerImpl : public LayerImpl {
25 public: 26 public:
26 static scoped_ptr<UIResourceLayerImpl> Create(LayerTreeImpl* tree_impl, 27 static std::unique_ptr<UIResourceLayerImpl> Create(LayerTreeImpl* tree_impl,
27 int id) { 28 int id) {
28 return make_scoped_ptr(new UIResourceLayerImpl(tree_impl, id)); 29 return base::WrapUnique(new UIResourceLayerImpl(tree_impl, id));
29 } 30 }
30 ~UIResourceLayerImpl() override; 31 ~UIResourceLayerImpl() override;
31 32
32 void SetUIResourceId(UIResourceId uid); 33 void SetUIResourceId(UIResourceId uid);
33 34
34 void SetImageBounds(const gfx::Size& image_bounds); 35 void SetImageBounds(const gfx::Size& image_bounds);
35 36
36 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1). 37 // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1).
37 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right); 38 void SetUV(const gfx::PointF& top_left, const gfx::PointF& bottom_right);
38 39
39 // Sets an opacity value per vertex. It will be multiplied by the layer 40 // Sets an opacity value per vertex. It will be multiplied by the layer
40 // opacity value. 41 // opacity value.
41 void SetVertexOpacity(const float vertex_opacity[4]); 42 void SetVertexOpacity(const float vertex_opacity[4]);
42 43
43 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; 44 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
44 void PushPropertiesTo(LayerImpl* layer) override; 45 void PushPropertiesTo(LayerImpl* layer) override;
45 46
46 bool WillDraw(DrawMode draw_mode, 47 bool WillDraw(DrawMode draw_mode,
47 ResourceProvider* resource_provider) override; 48 ResourceProvider* resource_provider) override;
48 void AppendQuads(RenderPass* render_pass, 49 void AppendQuads(RenderPass* render_pass,
49 AppendQuadsData* append_quads_data) override; 50 AppendQuadsData* append_quads_data) override;
50 51
51 base::DictionaryValue* LayerTreeAsJson() const override; 52 base::DictionaryValue* LayerTreeAsJson() const override;
52 53
53 protected: 54 protected:
(...skipping 10 matching lines...) Expand all
64 65
65 private: 66 private:
66 const char* LayerTypeAsString() const override; 67 const char* LayerTypeAsString() const override;
67 68
68 DISALLOW_COPY_AND_ASSIGN(UIResourceLayerImpl); 69 DISALLOW_COPY_AND_ASSIGN(UIResourceLayerImpl);
69 }; 70 };
70 71
71 } // namespace cc 72 } // namespace cc
72 73
73 #endif // CC_LAYERS_UI_RESOURCE_LAYER_IMPL_H_ 74 #endif // CC_LAYERS_UI_RESOURCE_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/ui_resource_layer.cc ('k') | cc/layers/ui_resource_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698