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