| 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 <unordered_map> | 10 #include <unordered_map> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 class EffectNodeData; | 23 class EffectNodeData; |
| 24 class PropertyTree; | 24 class PropertyTree; |
| 25 class PropertyTrees; | 25 class PropertyTrees; |
| 26 class ScrollNodeData; | 26 class ScrollNodeData; |
| 27 class TranformNodeData; | 27 class TranformNodeData; |
| 28 class TransformTreeData; | 28 class TransformTreeData; |
| 29 class TreeNode; | 29 class TreeNode; |
| 30 } | 30 } |
| 31 | 31 |
| 32 class LayerTreeImpl; | 32 class LayerTreeImpl; |
| 33 class ScrollState; |
| 33 struct ScrollAndScaleSet; | 34 struct ScrollAndScaleSet; |
| 34 | 35 |
| 35 // ------------------------------*IMPORTANT*--------------------------------- | 36 // ------------------------------*IMPORTANT*--------------------------------- |
| 36 // Each class declared here has a corresponding proto defined in | 37 // Each class declared here has a corresponding proto defined in |
| 37 // cc/proto/property_tree.proto. When making any changes to a class structure | 38 // cc/proto/property_tree.proto. When making any changes to a class structure |
| 38 // including addition/deletion/updation of a field, please also make the | 39 // including addition/deletion/updation of a field, please also make the |
| 39 // change to its proto and the ToProtobuf and FromProtobuf methods for that | 40 // change to its proto and the ToProtobuf and FromProtobuf methods for that |
| 40 // class. | 41 // class. |
| 41 | 42 |
| 42 typedef SyncedProperty<AdditionGroup<gfx::ScrollOffset>> SyncedScrollOffset; | 43 typedef SyncedProperty<AdditionGroup<gfx::ScrollOffset>> SyncedScrollOffset; |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 synced_scroll_offset(layer_id)->set_clobber_active_value(); | 590 synced_scroll_offset(layer_id)->set_clobber_active_value(); |
| 590 } | 591 } |
| 591 bool UpdateScrollOffsetBaseForTesting(int layer_id, | 592 bool UpdateScrollOffsetBaseForTesting(int layer_id, |
| 592 const gfx::ScrollOffset& offset); | 593 const gfx::ScrollOffset& offset); |
| 593 bool SetScrollOffsetDeltaForTesting(int layer_id, | 594 bool SetScrollOffsetDeltaForTesting(int layer_id, |
| 594 const gfx::Vector2dF& delta); | 595 const gfx::Vector2dF& delta); |
| 595 const gfx::ScrollOffset GetScrollOffsetBaseForTesting(int layer_id) const; | 596 const gfx::ScrollOffset GetScrollOffsetBaseForTesting(int layer_id) const; |
| 596 const gfx::ScrollOffset GetScrollOffsetDeltaForTesting(int layer_id) const; | 597 const gfx::ScrollOffset GetScrollOffsetDeltaForTesting(int layer_id) const; |
| 597 void CollectScrollDeltasForTesting(); | 598 void CollectScrollDeltasForTesting(); |
| 598 | 599 |
| 600 void DistributeScroll(ScrollNode* scroll_node, ScrollState* scroll_state); |
| 601 gfx::Vector2dF ScrollBy(ScrollNode* scroll_node, |
| 602 const gfx::Vector2dF& scroll, |
| 603 LayerTreeImpl* layer_tree_impl); |
| 604 |
| 599 private: | 605 private: |
| 600 int currently_scrolling_node_id_; | 606 int currently_scrolling_node_id_; |
| 601 ScrollOffsetMap layer_id_to_scroll_offset_map_; | 607 ScrollOffsetMap layer_id_to_scroll_offset_map_; |
| 602 | 608 |
| 603 SyncedScrollOffset* synced_scroll_offset(int layer_id); | 609 SyncedScrollOffset* synced_scroll_offset(int layer_id); |
| 604 const SyncedScrollOffset* synced_scroll_offset(int layer_id) const; | 610 const SyncedScrollOffset* synced_scroll_offset(int layer_id) const; |
| 605 gfx::ScrollOffset PullDeltaForMainThread(SyncedScrollOffset* scroll_offset); | 611 gfx::ScrollOffset PullDeltaForMainThread(SyncedScrollOffset* scroll_offset); |
| 606 void UpdateScrollOffsetMapEntry(int key, | 612 void UpdateScrollOffsetMapEntry(int key, |
| 607 ScrollOffsetMap* new_scroll_offset_map, | 613 ScrollOffsetMap* new_scroll_offset_map, |
| 608 LayerTreeImpl* layer_tree_impl); | 614 LayerTreeImpl* layer_tree_impl); |
| 615 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset, |
| 616 ScrollNode* scroll_node) const; |
| 609 }; | 617 }; |
| 610 | 618 |
| 611 class CC_EXPORT PropertyTrees final { | 619 class CC_EXPORT PropertyTrees final { |
| 612 public: | 620 public: |
| 613 PropertyTrees(); | 621 PropertyTrees(); |
| 614 ~PropertyTrees(); | 622 ~PropertyTrees(); |
| 615 | 623 |
| 616 bool operator==(const PropertyTrees& other) const; | 624 bool operator==(const PropertyTrees& other) const; |
| 617 PropertyTrees& operator=(const PropertyTrees& from); | 625 PropertyTrees& operator=(const PropertyTrees& from); |
| 618 | 626 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 | 669 |
| 662 private: | 670 private: |
| 663 gfx::Vector2dF inner_viewport_container_bounds_delta_; | 671 gfx::Vector2dF inner_viewport_container_bounds_delta_; |
| 664 gfx::Vector2dF outer_viewport_container_bounds_delta_; | 672 gfx::Vector2dF outer_viewport_container_bounds_delta_; |
| 665 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; | 673 gfx::Vector2dF inner_viewport_scroll_bounds_delta_; |
| 666 }; | 674 }; |
| 667 | 675 |
| 668 } // namespace cc | 676 } // namespace cc |
| 669 | 677 |
| 670 #endif // CC_TREES_PROPERTY_TREE_H_ | 678 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |