| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TREES_PROPERTY_TREE_H_ | 5 #ifndef CC_TREES_PROPERTY_TREE_H_ |
| 6 #define CC_TREES_PROPERTY_TREE_H_ | 6 #define CC_TREES_PROPERTY_TREE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 bool operator==(const PropertyTrees& other) const; | 669 bool operator==(const PropertyTrees& other) const; |
| 670 PropertyTrees& operator=(const PropertyTrees& from); | 670 PropertyTrees& operator=(const PropertyTrees& from); |
| 671 | 671 |
| 672 void ToProtobuf(proto::PropertyTrees* proto) const; | 672 void ToProtobuf(proto::PropertyTrees* proto) const; |
| 673 void FromProtobuf(const proto::PropertyTrees& proto); | 673 void FromProtobuf(const proto::PropertyTrees& proto); |
| 674 | 674 |
| 675 std::unordered_map<int, int> transform_id_to_index_map; | 675 std::unordered_map<int, int> transform_id_to_index_map; |
| 676 std::unordered_map<int, int> effect_id_to_index_map; | 676 std::unordered_map<int, int> effect_id_to_index_map; |
| 677 std::unordered_map<int, int> clip_id_to_index_map; | 677 std::unordered_map<int, int> clip_id_to_index_map; |
| 678 std::unordered_map<int, int> scroll_id_to_index_map; | 678 std::unordered_map<int, int> scroll_id_to_index_map; |
| 679 enum TreeType { TRANSFORM, EFFECT, CLIP, SCROLL }; | |
| 680 | 679 |
| 681 std::vector<int> always_use_active_tree_opacity_effect_ids; | 680 std::vector<int> always_use_active_tree_opacity_effect_ids; |
| 682 TransformTree transform_tree; | 681 TransformTree transform_tree; |
| 683 EffectTree effect_tree; | 682 EffectTree effect_tree; |
| 684 ClipTree clip_tree; | 683 ClipTree clip_tree; |
| 685 ScrollTree scroll_tree; | 684 ScrollTree scroll_tree; |
| 686 bool needs_rebuild; | 685 bool needs_rebuild; |
| 687 bool non_root_surfaces_enabled; | 686 bool non_root_surfaces_enabled; |
| 688 // Change tracking done on property trees needs to be preserved across commits | 687 // Change tracking done on property trees needs to be preserved across commits |
| 689 // (when they are not rebuild). We cache a global bool which stores whether | 688 // (when they are not rebuild). We cache a global bool which stores whether |
| 690 // we did any change tracking so that we can skip copying the change status | 689 // we did any change tracking so that we can skip copying the change status |
| 691 // between property trees when this bool is false. | 690 // between property trees when this bool is false. |
| 692 bool changed; | 691 bool changed; |
| 693 // We cache a global bool for full tree damages to avoid walking the entire | 692 // We cache a global bool for full tree damages to avoid walking the entire |
| 694 // tree. | 693 // tree. |
| 695 // TODO(jaydasika): Changes to transform and effects that damage the entire | 694 // TODO(jaydasika): Changes to transform and effects that damage the entire |
| 696 // tree should be tracked by this bool. Currently, they are tracked by the | 695 // tree should be tracked by this bool. Currently, they are tracked by the |
| 697 // individual nodes. | 696 // individual nodes. |
| 698 bool full_tree_damaged; | 697 bool full_tree_damaged; |
| 699 int sequence_number; | 698 int sequence_number; |
| 700 bool is_main_thread; | 699 bool is_main_thread; |
| 701 bool is_active; | 700 bool is_active; |
| 702 | 701 |
| 703 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); | 702 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); |
| 704 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); | 703 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); |
| 705 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta); | 704 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta); |
| 706 void PushOpacityIfNeeded(PropertyTrees* target_tree); | 705 void PushOpacityIfNeeded(PropertyTrees* target_tree); |
| 707 void RemoveIdFromIdToIndexMaps(int id); | |
| 708 bool IsInIdToIndexMap(TreeType tree_type, int id); | |
| 709 void UpdateChangeTracking(); | 706 void UpdateChangeTracking(); |
| 710 void PushChangeTrackingTo(PropertyTrees* tree); | 707 void PushChangeTrackingTo(PropertyTrees* tree); |
| 711 void ResetAllChangeTracking(); | 708 void ResetAllChangeTracking(); |
| 712 | 709 |
| 713 gfx::Vector2dF inner_viewport_container_bounds_delta() const { | 710 gfx::Vector2dF inner_viewport_container_bounds_delta() const { |
| 714 return inner_viewport_container_bounds_delta_; | 711 return inner_viewport_container_bounds_delta_; |
| 715 } | 712 } |
| 716 | 713 |
| 717 gfx::Vector2dF outer_viewport_container_bounds_delta() const { | 714 gfx::Vector2dF outer_viewport_container_bounds_delta() const { |
| 718 return outer_viewport_container_bounds_delta_; | 715 return outer_viewport_container_bounds_delta_; |
| 719 } | 716 } |
| 720 | 717 |
| 721 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const { | 718 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const { |
| 722 return inner_viewport_scroll_bounds_delta_; | 719 return inner_viewport_scroll_bounds_delta_; |
| 723 } | 720 } |
| 724 | 721 |
| 725 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; | 722 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; |
| 726 | 723 |
| 727 private: | 724 private: |
| 728 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 725 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 729 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 726 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 730 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 727 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 731 }; | 728 }; |
| 732 | 729 |
| 733 } // namespace cc | 730 } // namespace cc |
| 734 | 731 |
| 735 #endif // CC_TREES_PROPERTY_TREE_H_ | 732 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |