| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 struct StickyPositionNodeData { | 107 struct StickyPositionNodeData { |
| 108 int scroll_ancestor; | 108 int scroll_ancestor; |
| 109 LayerStickyPositionConstraint constraints; | 109 LayerStickyPositionConstraint constraints; |
| 110 | 110 |
| 111 // This is the offset that blink has already applied to counteract the main | 111 // This is the offset that blink has already applied to counteract the main |
| 112 // thread scroll offset of the scroll ancestor. We need to account for this | 112 // thread scroll offset of the scroll ancestor. We need to account for this |
| 113 // by computing the additional offset necessary to keep the element stuck. | 113 // by computing the additional offset necessary to keep the element stuck. |
| 114 gfx::Vector2dF main_thread_offset; | 114 gfx::Vector2dF main_thread_offset; |
| 115 | 115 |
| 116 StickyPositionNodeData() : scroll_ancestor(-1) {} | 116 // In order to properly compute the sticky offset, we need to know if we have |
| 117 // any sticky ancestors both between ourselves and our containing block and |
| 118 // between our containing block and the viewport. These ancestors are then |
| 119 // used to correct the constraining rect locations. |
| 120 int nearest_node_shifting_sticky_box; |
| 121 int nearest_node_shifting_containing_block; |
| 122 |
| 123 StickyPositionNodeData() |
| 124 : scroll_ancestor(-1), |
| 125 nearest_node_shifting_sticky_box(-1), |
| 126 nearest_node_shifting_containing_block(-1) {} |
| 117 }; | 127 }; |
| 118 | 128 |
| 119 class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> { | 129 class CC_EXPORT TransformTree final : public PropertyTree<TransformNode> { |
| 120 public: | 130 public: |
| 121 TransformTree(); | 131 TransformTree(); |
| 122 | 132 |
| 123 // These C++ special member functions cannot be implicit inline because | 133 // These C++ special member functions cannot be implicit inline because |
| 124 // they are exported by CC_EXPORT. They will be instantiated in every | 134 // they are exported by CC_EXPORT. They will be instantiated in every |
| 125 // compilation units that included this header, and compilation can fail | 135 // compilation units that included this header, and compilation can fail |
| 126 // because TransformCachedNodeData may be incomplete. | 136 // because TransformCachedNodeData may be incomplete. |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; | 672 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; |
| 663 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, | 673 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, |
| 664 int effect_id) const; | 674 int effect_id) const; |
| 665 | 675 |
| 666 PropertyTreesCachedData cached_data_; | 676 PropertyTreesCachedData cached_data_; |
| 667 }; | 677 }; |
| 668 | 678 |
| 669 } // namespace cc | 679 } // namespace cc |
| 670 | 680 |
| 671 #endif // CC_TREES_PROPERTY_TREE_H_ | 681 #endif // CC_TREES_PROPERTY_TREE_H_ |
| OLD | NEW |