Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: cc/trees/property_tree.h

Issue 1994333002: cc : Add IsInIdtoIndexMap to property tres (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECKs Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 };
679 680
680 std::vector<int> always_use_active_tree_opacity_effect_ids; 681 std::vector<int> always_use_active_tree_opacity_effect_ids;
681 TransformTree transform_tree; 682 TransformTree transform_tree;
682 EffectTree effect_tree; 683 EffectTree effect_tree;
683 ClipTree clip_tree; 684 ClipTree clip_tree;
684 ScrollTree scroll_tree; 685 ScrollTree scroll_tree;
685 bool needs_rebuild; 686 bool needs_rebuild;
686 bool non_root_surfaces_enabled; 687 bool non_root_surfaces_enabled;
687 // Change tracking done on property trees needs to be preserved across commits 688 // Change tracking done on property trees needs to be preserved across commits
688 // (when they are not rebuild). We cache a global bool which stores whether 689 // (when they are not rebuild). We cache a global bool which stores whether
689 // we did any change tracking so that we can skip copying the change status 690 // we did any change tracking so that we can skip copying the change status
690 // between property trees when this bool is false. 691 // between property trees when this bool is false.
691 bool changed; 692 bool changed;
692 // We cache a global bool for full tree damages to avoid walking the entire 693 // We cache a global bool for full tree damages to avoid walking the entire
693 // tree. 694 // tree.
694 // TODO(jaydasika): Changes to transform and effects that damage the entire 695 // TODO(jaydasika): Changes to transform and effects that damage the entire
695 // tree should be tracked by this bool. Currently, they are tracked by the 696 // tree should be tracked by this bool. Currently, they are tracked by the
696 // individual nodes. 697 // individual nodes.
697 bool full_tree_damaged; 698 bool full_tree_damaged;
698 int sequence_number; 699 int sequence_number;
699 bool is_main_thread; 700 bool is_main_thread;
700 bool is_active; 701 bool is_active;
701 enum ResetFlags { EFFECT_TREE, TRANSFORM_TREE, ALL_TREES }; 702 enum ResetFlags { EFFECT_TREE, TRANSFORM_TREE, ALL_TREES };
702 703
703 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); 704 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta);
704 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); 705 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta);
705 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta); 706 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta);
706 void PushOpacityIfNeeded(PropertyTrees* target_tree); 707 void PushOpacityIfNeeded(PropertyTrees* target_tree);
708 void RemoveIdFromIdToIndexMaps(int id);
709 bool IsInIdToIndexMap(TreeType tree_type, int id);
707 void UpdateChangeTracking(); 710 void UpdateChangeTracking();
708 void PushChangeTrackingTo(PropertyTrees* tree); 711 void PushChangeTrackingTo(PropertyTrees* tree);
709 void ResetAllChangeTracking(ResetFlags flag); 712 void ResetAllChangeTracking(ResetFlags flag);
710 713
711 gfx::Vector2dF inner_viewport_container_bounds_delta() const { 714 gfx::Vector2dF inner_viewport_container_bounds_delta() const {
712 return inner_viewport_container_bounds_delta_; 715 return inner_viewport_container_bounds_delta_;
713 } 716 }
714 717
715 gfx::Vector2dF outer_viewport_container_bounds_delta() const { 718 gfx::Vector2dF outer_viewport_container_bounds_delta() const {
716 return outer_viewport_container_bounds_delta_; 719 return outer_viewport_container_bounds_delta_;
717 } 720 }
718 721
719 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const { 722 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const {
720 return inner_viewport_scroll_bounds_delta_; 723 return inner_viewport_scroll_bounds_delta_;
721 } 724 }
722 725
723 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; 726 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const;
724 727
725 private: 728 private:
726 gfx::Vector2dF inner_viewport_container_bounds_delta_; 729 gfx::Vector2dF inner_viewport_container_bounds_delta_;
727 gfx::Vector2dF outer_viewport_container_bounds_delta_; 730 gfx::Vector2dF outer_viewport_container_bounds_delta_;
728 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 731 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
729 }; 732 };
730 733
731 } // namespace cc 734 } // namespace cc
732 735
733 #endif // CC_TREES_PROPERTY_TREE_H_ 736 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698