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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 virtual void NotifyTileStateChanged(const Tile* tile) {} | 281 virtual void NotifyTileStateChanged(const Tile* tile) {} |
282 | 282 |
283 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 283 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
284 | 284 |
285 // Returns true if this layer has content to draw. | 285 // Returns true if this layer has content to draw. |
286 void SetDrawsContent(bool draws_content); | 286 void SetDrawsContent(bool draws_content); |
287 bool DrawsContent() const { return draws_content_; } | 287 bool DrawsContent() const { return draws_content_; } |
288 | 288 |
289 int NumDescendantsThatDrawContent() const; | 289 int NumDescendantsThatDrawContent() const; |
290 void SetHideLayerAndSubtree(bool hide); | 290 void SetHideLayerAndSubtree(bool hide); |
291 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | |
292 | 291 |
293 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 292 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
294 gfx::Point3F transform_origin() const { return transform_origin_; } | 293 gfx::Point3F transform_origin() const { return transform_origin_; } |
295 | 294 |
296 void SetBackgroundColor(SkColor background_color); | 295 void SetBackgroundColor(SkColor background_color); |
297 SkColor background_color() const { return background_color_; } | 296 SkColor background_color() const { return background_color_; } |
298 // If contents_opaque(), return an opaque color else return a | 297 // If contents_opaque(), return an opaque color else return a |
299 // non-opaque color. Tries to return background_color(), if possible. | 298 // non-opaque color. Tries to return background_color(), if possible. |
300 SkColor SafeOpaqueBackgroundColor() const; | 299 SkColor SafeOpaqueBackgroundColor() const; |
301 | 300 |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 | 673 |
675 void set_sorted_for_recursion(bool sorted_for_recursion) { | 674 void set_sorted_for_recursion(bool sorted_for_recursion) { |
676 sorted_for_recursion_ = sorted_for_recursion; | 675 sorted_for_recursion_ = sorted_for_recursion; |
677 } | 676 } |
678 bool sorted_for_recursion() { return sorted_for_recursion_; } | 677 bool sorted_for_recursion() { return sorted_for_recursion_; } |
679 | 678 |
680 int num_copy_requests_in_target_subtree(); | 679 int num_copy_requests_in_target_subtree(); |
681 | 680 |
682 void UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); | 681 void UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); |
683 | 682 |
684 void set_is_hidden_from_property_trees(bool is_hidden) { | 683 bool IsHidden() const; |
685 if (is_hidden == is_hidden_from_property_trees_) | 684 bool IsDrawnFromPropertyTrees() const; |
686 return; | |
687 is_hidden_from_property_trees_ = is_hidden; | |
688 SetNeedsPushProperties(); | |
689 } | |
690 bool LayerIsHidden() const; | |
691 | 685 |
692 float GetIdealContentsScale() const; | 686 float GetIdealContentsScale() const; |
693 | 687 |
694 bool was_ever_ready_since_last_transform_animation() const { | 688 bool was_ever_ready_since_last_transform_animation() const { |
695 return was_ever_ready_since_last_transform_animation_; | 689 return was_ever_ready_since_last_transform_animation_; |
696 } | 690 } |
697 | 691 |
698 void set_was_ever_ready_since_last_transform_animation(bool was_ready) { | 692 void set_was_ever_ready_since_last_transform_animation(bool was_ready) { |
699 was_ever_ready_since_last_transform_animation_ = was_ready; | 693 was_ever_ready_since_last_transform_animation_ = was_ready; |
700 } | 694 } |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 bool should_flatten_transform_from_property_tree_ : 1; | 781 bool should_flatten_transform_from_property_tree_ : 1; |
788 | 782 |
789 // Tracks if drawing-related properties have changed since last redraw. | 783 // Tracks if drawing-related properties have changed since last redraw. |
790 bool layer_property_changed_ : 1; | 784 bool layer_property_changed_ : 1; |
791 | 785 |
792 bool masks_to_bounds_ : 1; | 786 bool masks_to_bounds_ : 1; |
793 bool contents_opaque_ : 1; | 787 bool contents_opaque_ : 1; |
794 bool is_root_for_isolated_group_ : 1; | 788 bool is_root_for_isolated_group_ : 1; |
795 bool use_parent_backface_visibility_ : 1; | 789 bool use_parent_backface_visibility_ : 1; |
796 bool draws_content_ : 1; | 790 bool draws_content_ : 1; |
797 bool hide_layer_and_subtree_ : 1; | |
798 | 791 |
799 // Cache transform_'s invertibility. | 792 // Cache transform_'s invertibility. |
800 bool transform_is_invertible_ : 1; | 793 bool transform_is_invertible_ : 1; |
801 | 794 |
802 // Set for the layer that other layers are fixed to. | 795 // Set for the layer that other layers are fixed to. |
803 bool is_container_for_fixed_position_layers_ : 1; | 796 bool is_container_for_fixed_position_layers_ : 1; |
804 | 797 |
805 bool is_affected_by_page_scale_ : 1; | 798 bool is_affected_by_page_scale_ : 1; |
806 | 799 |
807 // This is true if and only if the layer was ever ready since it last animated | 800 // This is true if and only if the layer was ever ready since it last animated |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 | 878 |
886 bool force_render_surface_; | 879 bool force_render_surface_; |
887 | 880 |
888 std::vector<FrameTimingRequest> frame_timing_requests_; | 881 std::vector<FrameTimingRequest> frame_timing_requests_; |
889 bool frame_timing_requests_dirty_; | 882 bool frame_timing_requests_dirty_; |
890 bool visited_; | 883 bool visited_; |
891 bool layer_or_descendant_is_drawn_; | 884 bool layer_or_descendant_is_drawn_; |
892 // If true, the layer or one of its descendants has a wheel or touch handler. | 885 // If true, the layer or one of its descendants has a wheel or touch handler. |
893 bool layer_or_descendant_has_input_handler_; | 886 bool layer_or_descendant_has_input_handler_; |
894 bool sorted_for_recursion_; | 887 bool sorted_for_recursion_; |
895 bool is_hidden_from_property_trees_; | |
896 | 888 |
897 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 889 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
898 }; | 890 }; |
899 | 891 |
900 } // namespace cc | 892 } // namespace cc |
901 | 893 |
902 #endif // CC_LAYERS_LAYER_IMPL_H_ | 894 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |