| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 gfx::ScrollOffset ScrollOffsetForAnimation() const; | 93 gfx::ScrollOffset ScrollOffsetForAnimation() const; |
| 94 void OnFilterAnimated(const FilterOperations& filters); | 94 void OnFilterAnimated(const FilterOperations& filters); |
| 95 void OnOpacityAnimated(float opacity); | 95 void OnOpacityAnimated(float opacity); |
| 96 void OnTransformAnimated(const gfx::Transform& transform); | 96 void OnTransformAnimated(const gfx::Transform& transform); |
| 97 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset); | 97 void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset); |
| 98 void OnTransformIsCurrentlyAnimatingChanged(bool is_currently_animating); | 98 void OnTransformIsCurrentlyAnimatingChanged(bool is_currently_animating); |
| 99 void OnTransformIsPotentiallyAnimatingChanged(bool has_potential_animation); | 99 void OnTransformIsPotentiallyAnimatingChanged(bool has_potential_animation); |
| 100 void OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating); | 100 void OnOpacityIsCurrentlyAnimatingChanged(bool is_currently_animating); |
| 101 void OnOpacityIsPotentiallyAnimatingChanged(bool has_potential_animation); | 101 void OnOpacityIsPotentiallyAnimatingChanged(bool has_potential_animation); |
| 102 bool IsActive() const; | 102 bool IsActive() const; |
| 103 bool OpacityCanAnimateOnImplThread() const { return false; } | |
| 104 | 103 |
| 105 // Tree structure. | 104 // Tree structure. |
| 106 LayerImpl* parent() { return parent_; } | 105 LayerImpl* parent() { return parent_; } |
| 107 LayerImplList& children() { return children_; } | 106 LayerImplList& children() { return children_; } |
| 108 LayerImpl* child_at(size_t index) const { return children_[index]; } | 107 LayerImpl* child_at(size_t index) const { return children_[index]; } |
| 109 void AddChild(std::unique_ptr<LayerImpl> child); | 108 void AddChild(std::unique_ptr<LayerImpl> child); |
| 110 std::unique_ptr<LayerImpl> RemoveChildForTesting(LayerImpl* child); | 109 std::unique_ptr<LayerImpl> RemoveChildForTesting(LayerImpl* child); |
| 111 void SetParent(LayerImpl* parent); | 110 void SetParent(LayerImpl* parent); |
| 112 | 111 |
| 113 void DistributeScroll(ScrollState* scroll_state); | 112 void DistributeScroll(ScrollState* scroll_state); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 140 SetNeedsPushProperties(); | 139 SetNeedsPushProperties(); |
| 141 } | 140 } |
| 142 bool should_flatten_transform_from_property_tree() const { | 141 bool should_flatten_transform_from_property_tree() const { |
| 143 return should_flatten_transform_from_property_tree_; | 142 return should_flatten_transform_from_property_tree_; |
| 144 } | 143 } |
| 145 | 144 |
| 146 bool is_clipped() const { return draw_properties_.is_clipped; } | 145 bool is_clipped() const { return draw_properties_.is_clipped; } |
| 147 | 146 |
| 148 void UpdatePropertyTreeTransform(); | 147 void UpdatePropertyTreeTransform(); |
| 149 void UpdatePropertyTreeTransformIsAnimated(bool is_animated); | 148 void UpdatePropertyTreeTransformIsAnimated(bool is_animated); |
| 150 void UpdatePropertyTreeOpacity(); | 149 void UpdatePropertyTreeOpacity(float opacity); |
| 151 void UpdatePropertyTreeScrollOffset(); | 150 void UpdatePropertyTreeScrollOffset(); |
| 152 | 151 |
| 153 // For compatibility with Layer. | 152 // For compatibility with Layer. |
| 154 bool has_render_surface() const { return !!render_surface(); } | 153 bool has_render_surface() const { return !!render_surface(); } |
| 155 | 154 |
| 156 void SetMaskLayer(std::unique_ptr<LayerImpl> mask_layer); | 155 void SetMaskLayer(std::unique_ptr<LayerImpl> mask_layer); |
| 157 LayerImpl* mask_layer() { return mask_layer_; } | 156 LayerImpl* mask_layer() { return mask_layer_; } |
| 158 const LayerImpl* mask_layer() const { return mask_layer_; } | 157 const LayerImpl* mask_layer() const { return mask_layer_; } |
| 159 std::unique_ptr<LayerImpl> TakeMaskLayer(); | 158 std::unique_ptr<LayerImpl> TakeMaskLayer(); |
| 160 | 159 |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 const FilterOperations& background_filters() const { | 224 const FilterOperations& background_filters() const { |
| 226 return background_filters_; | 225 return background_filters_; |
| 227 } | 226 } |
| 228 | 227 |
| 229 void SetMasksToBounds(bool masks_to_bounds); | 228 void SetMasksToBounds(bool masks_to_bounds); |
| 230 bool masks_to_bounds() const { return masks_to_bounds_; } | 229 bool masks_to_bounds() const { return masks_to_bounds_; } |
| 231 | 230 |
| 232 void SetContentsOpaque(bool opaque); | 231 void SetContentsOpaque(bool opaque); |
| 233 bool contents_opaque() const { return contents_opaque_; } | 232 bool contents_opaque() const { return contents_opaque_; } |
| 234 | 233 |
| 235 void SetOpacity(float opacity); | 234 float Opacity() const; |
| 236 float opacity() const { return opacity_; } | |
| 237 bool OpacityIsAnimating() const; | 235 bool OpacityIsAnimating() const; |
| 238 bool HasPotentiallyRunningOpacityAnimation() const; | 236 bool HasPotentiallyRunningOpacityAnimation() const; |
| 239 | 237 |
| 240 void SetElementId(uint64_t element_id); | 238 void SetElementId(uint64_t element_id); |
| 241 uint64_t element_id() const { return element_id_; } | 239 uint64_t element_id() const { return element_id_; } |
| 242 | 240 |
| 243 void SetMutableProperties(uint32_t properties); | 241 void SetMutableProperties(uint32_t properties); |
| 244 uint32_t mutable_properties() const { return mutable_properties_; } | 242 uint32_t mutable_properties() const { return mutable_properties_; } |
| 245 | 243 |
| 246 void SetBlendMode(SkXfermode::Mode); | 244 void SetBlendMode(SkXfermode::Mode); |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 | 584 |
| 587 // This is true if and only if the layer was ever ready since it last animated | 585 // This is true if and only if the layer was ever ready since it last animated |
| 588 // (all content was complete). | 586 // (all content was complete). |
| 589 bool was_ever_ready_since_last_transform_animation_ : 1; | 587 bool was_ever_ready_since_last_transform_animation_ : 1; |
| 590 | 588 |
| 591 Region non_fast_scrollable_region_; | 589 Region non_fast_scrollable_region_; |
| 592 Region touch_event_handler_region_; | 590 Region touch_event_handler_region_; |
| 593 SkColor background_color_; | 591 SkColor background_color_; |
| 594 SkColor safe_opaque_background_color_; | 592 SkColor safe_opaque_background_color_; |
| 595 | 593 |
| 596 float opacity_; | |
| 597 SkXfermode::Mode blend_mode_; | 594 SkXfermode::Mode blend_mode_; |
| 598 // draw_blend_mode may be different than blend_mode_, | 595 // draw_blend_mode may be different than blend_mode_, |
| 599 // when a RenderSurface re-parents the layer's blend_mode. | 596 // when a RenderSurface re-parents the layer's blend_mode. |
| 600 SkXfermode::Mode draw_blend_mode_; | 597 SkXfermode::Mode draw_blend_mode_; |
| 601 gfx::PointF position_; | 598 gfx::PointF position_; |
| 602 gfx::Transform transform_; | 599 gfx::Transform transform_; |
| 603 | 600 |
| 604 gfx::Rect clip_rect_in_target_space_; | 601 gfx::Rect clip_rect_in_target_space_; |
| 605 int transform_tree_index_; | 602 int transform_tree_index_; |
| 606 int effect_tree_index_; | 603 int effect_tree_index_; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 | 641 |
| 645 bool scrolls_drawn_descendant_; | 642 bool scrolls_drawn_descendant_; |
| 646 bool has_will_change_transform_hint_; | 643 bool has_will_change_transform_hint_; |
| 647 | 644 |
| 648 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 645 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 649 }; | 646 }; |
| 650 | 647 |
| 651 } // namespace cc | 648 } // namespace cc |
| 652 | 649 |
| 653 #endif // CC_LAYERS_LAYER_IMPL_H_ | 650 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |