OLD | NEW |
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_H_ | 5 #ifndef CC_LAYERS_NINE_PATCH_LAYER_H_ |
6 #define CC_LAYERS_NINE_PATCH_LAYER_H_ | 6 #define CC_LAYERS_NINE_PATCH_LAYER_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "cc/base/cc_export.h" | 11 #include "cc/base/cc_export.h" |
11 #include "cc/layers/layer.h" | 12 #include "cc/layers/layer.h" |
12 #include "cc/layers/ui_resource_layer.h" | 13 #include "cc/layers/ui_resource_layer.h" |
13 #include "cc/resources/ui_resource_client.h" | 14 #include "cc/resources/ui_resource_client.h" |
14 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
15 | 16 |
16 namespace cc { | 17 namespace cc { |
17 | 18 |
18 class LayerTreeHost; | 19 class LayerTreeHost; |
19 class ScopedUIResource; | 20 class ScopedUIResource; |
(...skipping 17 matching lines...) Expand all Loading... |
37 // on the edges of the layer. The corners are unscaled, the top and bottom | 38 // on the edges of the layer. The corners are unscaled, the top and bottom |
38 // rects are x-stretched to fit, and the left and right rects are | 39 // rects are x-stretched to fit, and the left and right rects are |
39 // y-stretched to fit. | 40 // y-stretched to fit. |
40 void SetAperture(const gfx::Rect& aperture); | 41 void SetAperture(const gfx::Rect& aperture); |
41 void SetFillCenter(bool fill_center); | 42 void SetFillCenter(bool fill_center); |
42 void SetNearestNeighbor(bool nearest_neighbor); | 43 void SetNearestNeighbor(bool nearest_neighbor); |
43 | 44 |
44 private: | 45 private: |
45 NinePatchLayer(); | 46 NinePatchLayer(); |
46 ~NinePatchLayer() override; | 47 ~NinePatchLayer() override; |
47 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 48 std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
48 | 49 |
49 gfx::Rect border_; | 50 gfx::Rect border_; |
50 bool fill_center_; | 51 bool fill_center_; |
51 bool nearest_neighbor_; | 52 bool nearest_neighbor_; |
52 | 53 |
53 // The transparent center region that shows the parent layer's contents in | 54 // The transparent center region that shows the parent layer's contents in |
54 // image space. | 55 // image space. |
55 gfx::Rect image_aperture_; | 56 gfx::Rect image_aperture_; |
56 | 57 |
57 DISALLOW_COPY_AND_ASSIGN(NinePatchLayer); | 58 DISALLOW_COPY_AND_ASSIGN(NinePatchLayer); |
58 }; | 59 }; |
59 | 60 |
60 } // namespace cc | 61 } // namespace cc |
61 | 62 |
62 #endif // CC_LAYERS_NINE_PATCH_LAYER_H_ | 63 #endif // CC_LAYERS_NINE_PATCH_LAYER_H_ |
OLD | NEW |