Chromium Code Reviews| 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_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" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 // | ------------ | : ~~~~~P~~~~~ | | 47 // | ------------ | : ~~~~~P~~~~~ | |
| 48 // | : | : | | 48 // | : | : | |
| 49 // | D | : | | 49 // | D | : | |
| 50 // | : | : | | 50 // | : | : | |
| 51 // ------------------------ ------------------------ | 51 // ------------------------ ------------------------ |
| 52 // | 52 // |
| 53 // |image_bounds| = (W, H) | 53 // |image_bounds| = (W, H) |
| 54 // |image_aperture| = (X, Y, P, Q) | 54 // |image_aperture| = (X, Y, P, Q) |
| 55 // |border| = (A, C, A + B, C + D) | 55 // |border| = (A, C, A + B, C + D) |
| 56 // |fill_center| indicates whether to draw the center quad or not. | 56 // |fill_center| indicates whether to draw the center quad or not. |
| 57 // |occlusion_rectangle| | |
|
Daniel Erat
2016/04/15 15:38:45
this comment doesn't do much good on its own. :-P
llandwerlin-old
2016/04/18 15:08:20
Done.
| |
| 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, |
| 62 const gfx::Rect& layer_occlusion); | |
| 61 | 63 |
| 62 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; | 64 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override; |
| 63 void PushPropertiesTo(LayerImpl* layer) override; | 65 void PushPropertiesTo(LayerImpl* layer) override; |
| 64 | 66 |
| 65 void AppendQuads(RenderPass* render_pass, | 67 void AppendQuads(RenderPass* render_pass, |
| 66 AppendQuadsData* append_quads_data) override; | 68 AppendQuadsData* append_quads_data) override; |
| 67 | 69 |
| 68 base::DictionaryValue* LayerTreeAsJson() const override; | 70 base::DictionaryValue* LayerTreeAsJson() const override; |
| 69 | 71 |
| 70 protected: | 72 protected: |
| 71 NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id); | 73 NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id); |
| 72 | 74 |
| 73 private: | 75 private: |
| 74 const char* LayerTypeAsString() const override; | 76 const char* LayerTypeAsString() const override; |
| 75 | 77 |
| 76 void CheckGeometryLimitations(); | 78 void CheckGeometryLimitations(); |
| 77 | 79 |
| 80 void AppendQuadsWithOcclusion(RenderPass* render_pass, | |
| 81 ResourceId resource, | |
| 82 SharedQuadState* shared_quad_state, | |
| 83 std::vector<gfx::Rect>* image_rects, | |
| 84 std::vector<gfx::Rect>* layer_rects); | |
| 85 void AppendQuadsWithoutOcclusion(RenderPass* render_pass, | |
| 86 ResourceId resource, | |
| 87 SharedQuadState* shared_quad_state, | |
| 88 std::vector<gfx::Rect>* image_rects, | |
| 89 std::vector<gfx::Rect>* layer_rects); | |
| 90 | |
| 78 // The transparent center region that shows the parent layer's contents in | 91 // The transparent center region that shows the parent layer's contents in |
| 79 // image space. | 92 // image space. |
| 80 gfx::Rect image_aperture_; | 93 gfx::Rect image_aperture_; |
| 81 | 94 |
| 82 // An inset border that the patches will be mapped to. | 95 // An inset border that the patches will be mapped to. |
| 83 gfx::Rect border_; | 96 gfx::Rect border_; |
| 84 | 97 |
| 85 bool fill_center_; | 98 bool fill_center_; |
| 86 | 99 |
| 87 bool nearest_neighbor_; | 100 bool nearest_neighbor_; |
| 88 | 101 |
| 102 gfx::Rect layer_occlusion_; | |
| 103 | |
| 89 DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl); | 104 DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl); |
| 90 }; | 105 }; |
| 91 | 106 |
| 92 } // namespace cc | 107 } // namespace cc |
| 93 | 108 |
| 94 #endif // CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_ | 109 #endif // CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_ |
| OLD | NEW |