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

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

Issue 2612093002: Build mapping from element id to transform/effect nodes. (Closed)
Patch Set: Check tree size in test. Created 3 years, 11 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 509 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 520
521 class CC_EXPORT PropertyTrees final { 521 class CC_EXPORT PropertyTrees final {
522 public: 522 public:
523 PropertyTrees(); 523 PropertyTrees();
524 PropertyTrees(const PropertyTrees& other) = delete; 524 PropertyTrees(const PropertyTrees& other) = delete;
525 ~PropertyTrees(); 525 ~PropertyTrees();
526 526
527 bool operator==(const PropertyTrees& other) const; 527 bool operator==(const PropertyTrees& other) const;
528 PropertyTrees& operator=(const PropertyTrees& from); 528 PropertyTrees& operator=(const PropertyTrees& from);
529 529
530 // These maps map from layer id to the index for each of the respective
531 // property node types.
530 std::unordered_map<int, int> transform_id_to_index_map; 532 std::unordered_map<int, int> transform_id_to_index_map;
531 std::unordered_map<int, int> effect_id_to_index_map; 533 std::unordered_map<int, int> effect_id_to_index_map;
532 std::unordered_map<int, int> clip_id_to_index_map; 534 std::unordered_map<int, int> clip_id_to_index_map;
533 std::unordered_map<int, int> scroll_id_to_index_map; 535 std::unordered_map<int, int> scroll_id_to_index_map;
534 enum TreeType { TRANSFORM, EFFECT, CLIP, SCROLL }; 536 enum TreeType { TRANSFORM, EFFECT, CLIP, SCROLL };
535 537
538 // These maps allow mapping directly from a compositor element id to the
539 // respective property node. This will eventually allow simplifying logic in
540 // various places that today has to map from element id to layer id, and then
541 // from layer id to the respective property node. Completing that work is
542 // pending the launch of Slimming Paint v2 and reworking UI compositor logic
543 // to produce cc property trees and these maps.
544 std::unordered_map<ElementId, int, ElementIdHash>
545 element_id_to_effect_node_index;
wkorman 2017/01/09 21:41:55 Checkpoint: have omitted the _map suffix that the
ajuma 2017/01/10 00:02:36 Seems reasonable, and renaming the rest to match i
546 std::unordered_map<ElementId, int, ElementIdHash>
547 element_id_to_transform_node_index;
548
536 std::vector<int> always_use_active_tree_opacity_effect_ids; 549 std::vector<int> always_use_active_tree_opacity_effect_ids;
537 TransformTree transform_tree; 550 TransformTree transform_tree;
538 EffectTree effect_tree; 551 EffectTree effect_tree;
539 ClipTree clip_tree; 552 ClipTree clip_tree;
540 ScrollTree scroll_tree; 553 ScrollTree scroll_tree;
541 bool needs_rebuild; 554 bool needs_rebuild;
542 bool non_root_surfaces_enabled; 555 bool non_root_surfaces_enabled;
543 // Change tracking done on property trees needs to be preserved across commits 556 // Change tracking done on property trees needs to be preserved across commits
544 // (when they are not rebuild). We cache a global bool which stores whether 557 // (when they are not rebuild). We cache a global bool which stores whether
545 // we did any change tracking so that we can skip copying the change status 558 // we did any change tracking so that we can skip copying the change status
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; 626 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const;
614 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, 627 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id,
615 int effect_id) const; 628 int effect_id) const;
616 629
617 PropertyTreesCachedData cached_data_; 630 PropertyTreesCachedData cached_data_;
618 }; 631 };
619 632
620 } // namespace cc 633 } // namespace cc
621 634
622 #endif // CC_TREES_PROPERTY_TREE_H_ 635 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698