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 <vector> | 10 #include <vector> |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 EffectNodeData(const EffectNodeData& other); | 251 EffectNodeData(const EffectNodeData& other); |
252 | 252 |
253 float opacity; | 253 float opacity; |
254 float screen_space_opacity; | 254 float screen_space_opacity; |
255 | 255 |
256 bool has_render_surface; | 256 bool has_render_surface; |
257 bool has_copy_request; | 257 bool has_copy_request; |
258 bool has_background_filters; | 258 bool has_background_filters; |
259 bool is_drawn; | 259 bool is_drawn; |
260 bool has_animated_opacity; | 260 bool has_animated_opacity; |
261 // We need to track changes to opacity on the compositor to compute damage | 261 // We need to track changes to effects on the compositor to compute damage |
262 // rect. | 262 // rect. |
263 bool opacity_changed; | 263 bool effect_changed; |
264 int num_copy_requests_in_subtree; | 264 int num_copy_requests_in_subtree; |
265 int transform_id; | 265 int transform_id; |
266 int clip_id; | 266 int clip_id; |
267 | 267 |
268 bool operator==(const EffectNodeData& other) const; | 268 bool operator==(const EffectNodeData& other) const; |
269 | 269 |
270 void ToProtobuf(proto::TreeNode* proto) const; | 270 void ToProtobuf(proto::TreeNode* proto) const; |
271 void FromProtobuf(const proto::TreeNode& proto); | 271 void FromProtobuf(const proto::TreeNode& proto); |
272 }; | 272 }; |
273 | 273 |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 void ToProtobuf(proto::PropertyTree* proto) const; | 521 void ToProtobuf(proto::PropertyTree* proto) const; |
522 void FromProtobuf(const proto::PropertyTree& proto); | 522 void FromProtobuf(const proto::PropertyTree& proto); |
523 }; | 523 }; |
524 | 524 |
525 class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> { | 525 class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> { |
526 public: | 526 public: |
527 bool operator==(const EffectTree& other) const; | 527 bool operator==(const EffectTree& other) const; |
528 | 528 |
529 void UpdateEffects(int id); | 529 void UpdateEffects(int id); |
530 | 530 |
531 void UpdateOpacityChanged(EffectNode* node, EffectNode* parent_node); | 531 void UpdateEffectChanged(EffectNode* node, EffectNode* parent_node); |
532 | 532 |
533 void ClearCopyRequests(); | 533 void ClearCopyRequests(); |
534 | 534 |
535 bool ContributesToDrawnSurface(int id); | 535 bool ContributesToDrawnSurface(int id); |
536 | 536 |
537 void ResetChangeTracking(); | 537 void ResetChangeTracking(); |
538 | 538 |
539 void ToProtobuf(proto::PropertyTree* proto) const; | 539 void ToProtobuf(proto::PropertyTree* proto) const; |
540 void FromProtobuf(const proto::PropertyTree& proto); | 540 void FromProtobuf(const proto::PropertyTree& proto); |
541 | 541 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 EffectTree effect_tree; | 580 EffectTree effect_tree; |
581 ClipTree clip_tree; | 581 ClipTree clip_tree; |
582 ScrollTree scroll_tree; | 582 ScrollTree scroll_tree; |
583 bool needs_rebuild; | 583 bool needs_rebuild; |
584 bool non_root_surfaces_enabled; | 584 bool non_root_surfaces_enabled; |
585 // Change tracking done on property trees needs to be preserved across commits | 585 // Change tracking done on property trees needs to be preserved across commits |
586 // (when they are not rebuild). We cache a global bool which stores whether | 586 // (when they are not rebuild). We cache a global bool which stores whether |
587 // we did any change tracking so that we can skip copying the change status | 587 // we did any change tracking so that we can skip copying the change status |
588 // between property trees when this bool is false. | 588 // between property trees when this bool is false. |
589 bool changed; | 589 bool changed; |
| 590 // We cache a global bool for full tree damages to avoid walking the entire |
| 591 // tree. |
| 592 // TODO(jaydasika): Changes to transform and effects that damage the entire |
| 593 // tree should be tracked by this bool. Currently, they are tracked by the |
| 594 // individual nodes. |
| 595 bool full_tree_damaged; |
590 int sequence_number; | 596 int sequence_number; |
| 597 enum ResetFlags { EFFECT_TREE, TRANSFORM_TREE, ALL_TREES }; |
591 | 598 |
592 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); | 599 void SetInnerViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); |
593 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); | 600 void SetOuterViewportContainerBoundsDelta(gfx::Vector2dF bounds_delta); |
594 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta); | 601 void SetInnerViewportScrollBoundsDelta(gfx::Vector2dF bounds_delta); |
595 void PushChangeTrackingTo(PropertyTrees* tree); | 602 void PushChangeTrackingTo(PropertyTrees* tree); |
| 603 void ResetAllChangeTracking(ResetFlags flag); |
596 | 604 |
597 gfx::Vector2dF inner_viewport_container_bounds_delta() const { | 605 gfx::Vector2dF inner_viewport_container_bounds_delta() const { |
598 return inner_viewport_container_bounds_delta_; | 606 return inner_viewport_container_bounds_delta_; |
599 } | 607 } |
600 | 608 |
601 gfx::Vector2dF outer_viewport_container_bounds_delta() const { | 609 gfx::Vector2dF outer_viewport_container_bounds_delta() const { |
602 return outer_viewport_container_bounds_delta_; | 610 return outer_viewport_container_bounds_delta_; |
603 } | 611 } |
604 | 612 |
605 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const { | 613 gfx::Vector2dF inner_viewport_scroll_bounds_delta() const { |
606 return inner_viewport_scroll_bounds_delta_; | 614 return inner_viewport_scroll_bounds_delta_; |
607 } | 615 } |
608 | 616 |
609 private: | 617 private: |
610 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 618 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
611 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 619 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
612 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 620 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
613 }; | 621 }; |
614 | 622 |
615 } // namespace cc | 623 } // namespace cc |
616 | 624 |
617 #endif // CC_TREES_PROPERTY_TREE_H_ | 625 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |