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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 530 // These maps map from layer id to the index for each of the respective |
531 // property node types. | 531 // property node types. |
532 std::unordered_map<int, int> transform_id_to_index_map; | 532 std::unordered_map<int, int> layer_id_to_transform_node_index; |
533 std::unordered_map<int, int> effect_id_to_index_map; | 533 std::unordered_map<int, int> layer_id_to_effect_node_index; |
534 std::unordered_map<int, int> clip_id_to_index_map; | 534 std::unordered_map<int, int> layer_id_to_clip_node_index; |
535 std::unordered_map<int, int> scroll_id_to_index_map; | 535 std::unordered_map<int, int> layer_id_to_scroll_node_index; |
536 enum TreeType { TRANSFORM, EFFECT, CLIP, SCROLL }; | 536 enum TreeType { TRANSFORM, EFFECT, CLIP, SCROLL }; |
537 | 537 |
538 // These maps allow mapping directly from a compositor element id to the | 538 // These maps allow mapping directly from a compositor element id to the |
539 // respective property node. This will eventually allow simplifying logic in | 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 | 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 | 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 | 542 // pending the launch of Slimming Paint v2 and reworking UI compositor logic |
543 // to produce cc property trees and these maps. | 543 // to produce cc property trees and these maps. |
544 std::unordered_map<ElementId, int, ElementIdHash> | 544 std::unordered_map<ElementId, int, ElementIdHash> |
545 element_id_to_effect_node_index; | 545 element_id_to_effect_node_index; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; | 626 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; |
627 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, | 627 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, |
628 int effect_id) const; | 628 int effect_id) const; |
629 | 629 |
630 PropertyTreesCachedData cached_data_; | 630 PropertyTreesCachedData cached_data_; |
631 }; | 631 }; |
632 | 632 |
633 } // namespace cc | 633 } // namespace cc |
634 | 634 |
635 #endif // CC_TREES_PROPERTY_TREE_H_ | 635 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |