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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 std::vector<int> nodes_affected_by_inner_viewport_bounds_delta_; | 321 std::vector<int> nodes_affected_by_inner_viewport_bounds_delta_; |
322 std::vector<int> nodes_affected_by_outer_viewport_bounds_delta_; | 322 std::vector<int> nodes_affected_by_outer_viewport_bounds_delta_; |
323 std::vector<TransformCachedNodeData> cached_data_; | 323 std::vector<TransformCachedNodeData> cached_data_; |
324 std::vector<StickyPositionNodeData> sticky_position_data_; | 324 std::vector<StickyPositionNodeData> sticky_position_data_; |
325 }; | 325 }; |
326 | 326 |
327 struct StickyPositionNodeData { | 327 struct StickyPositionNodeData { |
328 int scroll_ancestor; | 328 int scroll_ancestor; |
329 LayerStickyPositionConstraint constraints; | 329 LayerStickyPositionConstraint constraints; |
330 | 330 |
331 // This is the offset that blink has already applied to counteract the main | |
332 // thread scroll offset of the scroll ancestor. We need to account for this | |
333 // by computing the additional offset necessary to keep the element stuck. | |
334 gfx::Vector2dF main_thread_offset; | |
335 | |
336 // In order to properly compute the sticky offset, we need to know if we have | 331 // In order to properly compute the sticky offset, we need to know if we have |
337 // any sticky ancestors both between ourselves and our containing block and | 332 // any sticky ancestors both between ourselves and our containing block and |
338 // between our containing block and the viewport. These ancestors are then | 333 // between our containing block and the viewport. These ancestors are then |
339 // used to correct the constraining rect locations. | 334 // used to correct the constraining rect locations. |
340 int nearest_node_shifting_sticky_box; | 335 int nearest_node_shifting_sticky_box; |
341 int nearest_node_shifting_containing_block; | 336 int nearest_node_shifting_containing_block; |
342 | 337 |
343 // For performance we cache our accumulated sticky offset to allow descendant | 338 // For performance we cache our accumulated sticky offset to allow descendant |
344 // sticky elements to offset their constraint rects. Because we can either | 339 // sticky elements to offset their constraint rects. Because we can either |
345 // affect the sticky box constraint rect or the containing block constraint | 340 // affect the sticky box constraint rect or the containing block constraint |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; | 750 DrawTransforms& GetDrawTransforms(int transform_id, int effect_id) const; |
756 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, | 751 DrawTransformData& FetchDrawTransformsDataFromCache(int transform_id, |
757 int effect_id) const; | 752 int effect_id) const; |
758 | 753 |
759 PropertyTreesCachedData cached_data_; | 754 PropertyTreesCachedData cached_data_; |
760 }; | 755 }; |
761 | 756 |
762 } // namespace cc | 757 } // namespace cc |
763 | 758 |
764 #endif // CC_TREES_PROPERTY_TREE_H_ | 759 #endif // CC_TREES_PROPERTY_TREE_H_ |
OLD | NEW |