| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_LAYER_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 SkColor SafeOpaqueBackgroundColor() const; | 108 SkColor SafeOpaqueBackgroundColor() const; |
| 109 | 109 |
| 110 // A layer's bounds are in logical, non-page-scaled pixels (however, the | 110 // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 111 // root layer's bounds are in physical pixels). | 111 // root layer's bounds are in physical pixels). |
| 112 void SetBounds(const gfx::Size& bounds); | 112 void SetBounds(const gfx::Size& bounds); |
| 113 gfx::Size bounds() const { return inputs_.bounds; } | 113 gfx::Size bounds() const { return inputs_.bounds; } |
| 114 | 114 |
| 115 void SetMasksToBounds(bool masks_to_bounds); | 115 void SetMasksToBounds(bool masks_to_bounds); |
| 116 bool masks_to_bounds() const { return inputs_.masks_to_bounds; } | 116 bool masks_to_bounds() const { return inputs_.masks_to_bounds; } |
| 117 | 117 |
| 118 // Note that the mask layer is not scaled to fill the layer being masked. |
| 118 void SetMaskLayer(Layer* mask_layer); | 119 void SetMaskLayer(Layer* mask_layer); |
| 119 Layer* mask_layer() { return inputs_.mask_layer.get(); } | 120 Layer* mask_layer() { return inputs_.mask_layer.get(); } |
| 120 const Layer* mask_layer() const { return inputs_.mask_layer.get(); } | 121 const Layer* mask_layer() const { return inputs_.mask_layer.get(); } |
| 121 | 122 |
| 122 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); | 123 virtual void SetNeedsDisplayRect(const gfx::Rect& dirty_rect); |
| 123 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } | 124 void SetNeedsDisplay() { SetNeedsDisplayRect(gfx::Rect(bounds())); } |
| 124 | 125 |
| 125 virtual void SetOpacity(float opacity); | 126 virtual void SetOpacity(float opacity); |
| 126 float opacity() const { return inputs_.opacity; } | 127 float opacity() const { return inputs_.opacity; } |
| 127 float EffectiveOpacity() const; | 128 float EffectiveOpacity() const; |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 // These all act like draw properties, so don't need push properties. | 638 // These all act like draw properties, so don't need push properties. |
| 638 gfx::Rect visible_layer_rect_; | 639 gfx::Rect visible_layer_rect_; |
| 639 size_t num_unclipped_descendants_; | 640 size_t num_unclipped_descendants_; |
| 640 | 641 |
| 641 DISALLOW_COPY_AND_ASSIGN(Layer); | 642 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 642 }; | 643 }; |
| 643 | 644 |
| 644 } // namespace cc | 645 } // namespace cc |
| 645 | 646 |
| 646 #endif // CC_LAYERS_LAYER_H_ | 647 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |