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

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

Issue 2035863003: cc: Add mask and replica layer ids to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 6 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
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 17 matching lines...) Expand all
28 namespace proto { 28 namespace proto {
29 class ClipNodeData; 29 class ClipNodeData;
30 class EffectNodeData; 30 class EffectNodeData;
31 class PropertyTree; 31 class PropertyTree;
32 class PropertyTrees; 32 class PropertyTrees;
33 class ScrollNodeData; 33 class ScrollNodeData;
34 class TransformNodeData; 34 class TransformNodeData;
35 class TransformCachedNodeData; 35 class TransformCachedNodeData;
36 class TransformTreeData; 36 class TransformTreeData;
37 class TreeNode; 37 class TreeNode;
38 } 38 } // namespace proto
39 39
40 class CopyOutputRequest; 40 class CopyOutputRequest;
41 class LayerTreeImpl; 41 class LayerTreeImpl;
42 class RenderSurfaceImpl; 42 class RenderSurfaceImpl;
43 class ScrollState; 43 class ScrollState;
44 struct ScrollAndScaleSet; 44 struct ScrollAndScaleSet;
45 45
46 // ------------------------------*IMPORTANT*--------------------------------- 46 // ------------------------------*IMPORTANT*---------------------------------
47 // Each class declared here has a corresponding proto defined in 47 // Each class declared here has a corresponding proto defined in
48 // cc/proto/property_tree.proto. When making any changes to a class structure 48 // cc/proto/property_tree.proto. When making any changes to a class structure
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 bool is_currently_animating_opacity; 301 bool is_currently_animating_opacity;
302 // We need to track changes to effects on the compositor to compute damage 302 // We need to track changes to effects on the compositor to compute damage
303 // rect. 303 // rect.
304 bool effect_changed; 304 bool effect_changed;
305 int num_copy_requests_in_subtree; 305 int num_copy_requests_in_subtree;
306 bool has_unclipped_descendants; 306 bool has_unclipped_descendants;
307 int transform_id; 307 int transform_id;
308 int clip_id; 308 int clip_id;
309 // Effect node id of which this effect contributes to. 309 // Effect node id of which this effect contributes to.
310 int target_id; 310 int target_id;
311 int mask_layer_id;
312 int replica_layer_id;
313 int replica_mask_layer_id;
311 314
312 bool operator==(const EffectNodeData& other) const; 315 bool operator==(const EffectNodeData& other) const;
313 316
314 void ToProtobuf(proto::TreeNode* proto) const; 317 void ToProtobuf(proto::TreeNode* proto) const;
315 void FromProtobuf(const proto::TreeNode& proto); 318 void FromProtobuf(const proto::TreeNode& proto);
316 void AsValueInto(base::trace_event::TracedValue* value) const; 319 void AsValueInto(base::trace_event::TracedValue* value) const;
317 }; 320 };
318 321
319 typedef TreeNode<EffectNodeData> EffectNode; 322 typedef TreeNode<EffectNodeData> EffectNode;
320 323
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 }; 608 };
606 609
607 class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> { 610 class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
608 public: 611 public:
609 EffectTree(); 612 EffectTree();
610 ~EffectTree(); 613 ~EffectTree();
611 614
612 EffectTree& operator=(const EffectTree& from); 615 EffectTree& operator=(const EffectTree& from);
613 bool operator==(const EffectTree& other) const; 616 bool operator==(const EffectTree& other) const;
614 617
618 void clear();
619
615 float EffectiveOpacity(const EffectNode* node) const; 620 float EffectiveOpacity(const EffectNode* node) const;
616 621
617 void UpdateEffects(int id); 622 void UpdateEffects(int id);
618 623
619 void UpdateEffectChanged(EffectNode* node, EffectNode* parent_node); 624 void UpdateEffectChanged(EffectNode* node, EffectNode* parent_node);
620 625
621 void AddCopyRequest(int node_id, std::unique_ptr<CopyOutputRequest> request); 626 void AddCopyRequest(int node_id, std::unique_ptr<CopyOutputRequest> request);
622 void PushCopyRequestsTo(EffectTree* other_tree); 627 void PushCopyRequestsTo(EffectTree* other_tree);
623 void TakeCopyRequestsAndTransformToSurface( 628 void TakeCopyRequestsAndTransformToSurface(
624 int node_id, 629 int node_id,
625 std::vector<std::unique_ptr<CopyOutputRequest>>* requests); 630 std::vector<std::unique_ptr<CopyOutputRequest>>* requests);
626 bool HasCopyRequests() const; 631 bool HasCopyRequests() const;
627 void ClearCopyRequests(); 632 void ClearCopyRequests();
628 633
634 void AddMaskOrReplicaLayerId(int id);
635 const std::vector<int>& mask_replica_layer_ids() const {
636 return mask_replica_layer_ids_;
637 }
638
629 bool ContributesToDrawnSurface(int id); 639 bool ContributesToDrawnSurface(int id);
630 640
631 void ResetChangeTracking(); 641 void ResetChangeTracking();
632 642
633 void ToProtobuf(proto::PropertyTree* proto) const; 643 void ToProtobuf(proto::PropertyTree* proto) const;
634 void FromProtobuf(const proto::PropertyTree& proto, 644 void FromProtobuf(const proto::PropertyTree& proto,
635 std::unordered_map<int, int>* node_id_to_index_map); 645 std::unordered_map<int, int>* node_id_to_index_map);
636 646
637 private: 647 private:
638 void UpdateOpacities(EffectNode* node, EffectNode* parent_node); 648 void UpdateOpacities(EffectNode* node, EffectNode* parent_node);
639 void UpdateIsDrawn(EffectNode* node, EffectNode* parent_node); 649 void UpdateIsDrawn(EffectNode* node, EffectNode* parent_node);
640 void UpdateBackfaceVisibility(EffectNode* node, EffectNode* parent_node); 650 void UpdateBackfaceVisibility(EffectNode* node, EffectNode* parent_node);
641 651
642 // Stores copy requests, keyed by node id. 652 // Stores copy requests, keyed by node id.
643 std::unordered_multimap<int, std::unique_ptr<CopyOutputRequest>> 653 std::unordered_multimap<int, std::unique_ptr<CopyOutputRequest>>
644 copy_requests_; 654 copy_requests_;
655
656 // Unsorted list of all mask, replica, and replica mask layer ids that
657 // effect nodes refer to.
658 std::vector<int> mask_replica_layer_ids_;
645 }; 659 };
646 660
647 class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> { 661 class CC_EXPORT ScrollTree final : public PropertyTree<ScrollNode> {
648 public: 662 public:
649 ScrollTree(); 663 ScrollTree();
650 ~ScrollTree(); 664 ~ScrollTree();
651 665
652 ScrollTree& operator=(const ScrollTree& from); 666 ScrollTree& operator=(const ScrollTree& from);
653 bool operator==(const ScrollTree& other) const; 667 bool operator==(const ScrollTree& other) const;
654 668
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 788
775 private: 789 private:
776 gfx::Vector2dF inner_viewport_container_bounds_delta_; 790 gfx::Vector2dF inner_viewport_container_bounds_delta_;
777 gfx::Vector2dF outer_viewport_container_bounds_delta_; 791 gfx::Vector2dF outer_viewport_container_bounds_delta_;
778 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; 792 gfx::Vector2dF inner_viewport_scroll_bounds_delta_;
779 }; 793 };
780 794
781 } // namespace cc 795 } // namespace cc
782 796
783 #endif // CC_TREES_PROPERTY_TREE_H_ 797 #endif // CC_TREES_PROPERTY_TREE_H_
OLDNEW
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698