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 "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 23 matching lines...) Expand all Loading... | |
34 // aperture is in the pixel space of the bitmap resource and refers to | 34 // aperture is in the pixel space of the bitmap resource and refers to |
35 // the center patch of the ninepatch (which is unused in this | 35 // the center patch of the ninepatch (which is unused in this |
36 // implementation). We split off eight rects surrounding it and stick them | 36 // implementation). We split off eight rects surrounding it and stick them |
37 // on the edges of the layer. The corners are unscaled, the top and bottom | 37 // 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 | 38 // rects are x-stretched to fit, and the left and right rects are |
39 // y-stretched to fit. | 39 // y-stretched to fit. |
40 void SetAperture(const gfx::Rect& aperture); | 40 void SetAperture(const gfx::Rect& aperture); |
41 void SetFillCenter(bool fill_center); | 41 void SetFillCenter(bool fill_center); |
42 void SetNearestNeighbor(bool nearest_neighbor); | 42 void SetNearestNeighbor(bool nearest_neighbor); |
43 | 43 |
44 // |rect| is the space completly occluded by another layer in layer space. | |
Daniel Erat
2016/04/15 15:38:45
nit: s/completly/completely/
llandwerlin-old
2016/04/18 15:08:20
Done.
| |
45 // This can be used for example to occlude the entire window's content | |
46 // when drawing the shadow with a 9 patches layer. | |
47 void SetLayerOcclusion(const gfx::Rect& rect); | |
48 | |
44 private: | 49 private: |
45 NinePatchLayer(); | 50 NinePatchLayer(); |
46 ~NinePatchLayer() override; | 51 ~NinePatchLayer() override; |
47 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 52 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
48 | 53 |
49 gfx::Rect border_; | 54 gfx::Rect border_; |
50 bool fill_center_; | 55 bool fill_center_; |
51 bool nearest_neighbor_; | 56 bool nearest_neighbor_; |
52 | 57 |
53 // The transparent center region that shows the parent layer's contents in | 58 // The transparent center region that shows the parent layer's contents in |
54 // image space. | 59 // image space. |
55 gfx::Rect image_aperture_; | 60 gfx::Rect image_aperture_; |
56 | 61 |
62 gfx::Rect layer_occlusion_; | |
Daniel Erat
2016/04/15 15:38:45
nit: add a brief comment describing this member (m
llandwerlin-old
2016/04/18 15:08:20
Done.
| |
63 | |
57 DISALLOW_COPY_AND_ASSIGN(NinePatchLayer); | 64 DISALLOW_COPY_AND_ASSIGN(NinePatchLayer); |
58 }; | 65 }; |
59 | 66 |
60 } // namespace cc | 67 } // namespace cc |
61 | 68 |
62 #endif // CC_LAYERS_NINE_PATCH_LAYER_H_ | 69 #endif // CC_LAYERS_NINE_PATCH_LAYER_H_ |
OLD | NEW |