Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Side by Side Diff: cc/layers/layer_sticky_position_constraint.h

Issue 2401903002: Compute and include the offset of the sticky box to its enclosing composited layer. (Closed)
Patch Set: Merge with master and fix long line. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_sticky_position_constraint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_ 5 #ifndef CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
6 #define CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_ 6 #define CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 9
10 #include "ui/gfx/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 14 matching lines...) Expand all
25 bool is_anchored_top : 1; 25 bool is_anchored_top : 1;
26 bool is_anchored_bottom : 1; 26 bool is_anchored_bottom : 1;
27 27
28 // The offset from each edge of the ancestor scroller (or the viewport) to 28 // The offset from each edge of the ancestor scroller (or the viewport) to
29 // try to maintain to the sticky box as we scroll. 29 // try to maintain to the sticky box as we scroll.
30 float left_offset; 30 float left_offset;
31 float right_offset; 31 float right_offset;
32 float top_offset; 32 float top_offset;
33 float bottom_offset; 33 float bottom_offset;
34 34
35 // The layout offset of the sticky box relative to its containing layer.
36 // This is used to detect the sticky offset the main thread has applied
37 // to the layer.
38 gfx::Point parent_relative_sticky_box_offset;
39
35 // The rectangle corresponding to original layout position of the sticky box 40 // The rectangle corresponding to original layout position of the sticky box
36 // relative to the scroll ancestor. The sticky box is only offset once the 41 // relative to the scroll ancestor. The sticky box is only offset once the
37 // scroll has passed its initial position (e.g. top_offset will only push 42 // scroll has passed its initial position (e.g. top_offset will only push
38 // the element down from its original position). 43 // the element down from its original position).
39 gfx::Rect scroll_container_relative_sticky_box_rect; 44 gfx::Rect scroll_container_relative_sticky_box_rect;
40 45
41 // The layout rectangle of the sticky box's containing block relative to the 46 // The layout rectangle of the sticky box's containing block relative to the
42 // scroll ancestor. The sticky box is only moved as far as its containing 47 // scroll ancestor. The sticky box is only moved as far as its containing
43 // block boundary. 48 // block boundary.
44 gfx::Rect scroll_container_relative_containing_block_rect; 49 gfx::Rect scroll_container_relative_containing_block_rect;
45 50
46 void ToProtobuf(proto::LayerStickyPositionConstraint* proto) const; 51 void ToProtobuf(proto::LayerStickyPositionConstraint* proto) const;
47 void FromProtobuf(const proto::LayerStickyPositionConstraint& proto); 52 void FromProtobuf(const proto::LayerStickyPositionConstraint& proto);
48 53
49 bool operator==(const LayerStickyPositionConstraint&) const; 54 bool operator==(const LayerStickyPositionConstraint&) const;
50 bool operator!=(const LayerStickyPositionConstraint&) const; 55 bool operator!=(const LayerStickyPositionConstraint&) const;
51 }; 56 };
52 57
53 } // namespace cc 58 } // namespace cc
54 59
55 #endif // CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_ 60 #endif // CC_LAYERS_LAYER_STICKY_POSITION_CONSTRAINT_H_
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_sticky_position_constraint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698