OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TRANSFORM_NODE_H_ | 5 #ifndef CC_TREES_TRANSFORM_NODE_H_ |
6 #define CC_TREES_TRANSFORM_NODE_H_ | 6 #define CC_TREES_TRANSFORM_NODE_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "ui/gfx/geometry/point_f.h" | 9 #include "ui/gfx/geometry/point_f.h" |
10 #include "ui/gfx/geometry/scroll_offset.h" | 10 #include "ui/gfx/geometry/scroll_offset.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 | 87 |
88 // This is true if the to_parent transform at every node on the path to the | 88 // This is true if the to_parent transform at every node on the path to the |
89 // root is flat. | 89 // root is flat. |
90 bool node_and_ancestors_are_flat : 1; | 90 bool node_and_ancestors_are_flat : 1; |
91 | 91 |
92 // This is needed to know if a layer can use lcd text. | 92 // This is needed to know if a layer can use lcd text. |
93 bool node_and_ancestors_have_only_integer_translation : 1; | 93 bool node_and_ancestors_have_only_integer_translation : 1; |
94 | 94 |
95 bool scrolls : 1; | 95 bool scrolls : 1; |
96 | 96 |
| 97 bool should_be_snapped : 1; |
| 98 |
97 // These are used to position nodes wrt the right or bottom of the inner or | 99 // These are used to position nodes wrt the right or bottom of the inner or |
98 // outer viewport. | 100 // outer viewport. |
99 bool affected_by_inner_viewport_bounds_delta_x : 1; | 101 bool affected_by_inner_viewport_bounds_delta_x : 1; |
100 bool affected_by_inner_viewport_bounds_delta_y : 1; | 102 bool affected_by_inner_viewport_bounds_delta_y : 1; |
101 bool affected_by_outer_viewport_bounds_delta_x : 1; | 103 bool affected_by_outer_viewport_bounds_delta_x : 1; |
102 bool affected_by_outer_viewport_bounds_delta_y : 1; | 104 bool affected_by_outer_viewport_bounds_delta_y : 1; |
103 | 105 |
104 // Layer scale factor is used as a fallback when we either cannot adjust | 106 // Layer scale factor is used as a fallback when we either cannot adjust |
105 // raster scale or if the raster scale cannot be extracted from the screen | 107 // raster scale or if the raster scale cannot be extracted from the screen |
106 // space transform. For layers in the subtree of the page scale layer, the | 108 // space transform. For layers in the subtree of the page scale layer, the |
107 // layer scale factor should include the page scale factor. | 109 // layer scale factor should include the page scale factor. |
108 bool in_subtree_of_page_scale_layer : 1; | 110 bool in_subtree_of_page_scale_layer : 1; |
109 | 111 |
110 // We need to track changes to to_screen transform to compute the damage rect. | 112 // We need to track changes to to_screen transform to compute the damage rect. |
111 bool transform_changed : 1; | 113 bool transform_changed : 1; |
112 | 114 |
113 // TODO(vollick): will be moved when accelerated effects are implemented. | 115 // TODO(vollick): will be moved when accelerated effects are implemented. |
114 float post_local_scale_factor; | 116 float post_local_scale_factor; |
115 | 117 |
116 // TODO(vollick): will be moved when accelerated effects are implemented. | 118 // TODO(vollick): will be moved when accelerated effects are implemented. |
117 gfx::ScrollOffset scroll_offset; | 119 gfx::ScrollOffset scroll_offset; |
118 | 120 |
119 // We scroll snap where possible, but this means fixed-pos elements must be | 121 // This value stores the snapped amount whenever we snap. If the snap is due |
120 // adjusted. This value stores the snapped amount for this purpose. | 122 // to a scroll, we need it to calculate fixed-pos elements adjustment, even |
121 gfx::Vector2dF scroll_snap; | 123 // otherwise we may need it to undo the snapping next frame. |
| 124 gfx::Vector2dF snap_amount; |
122 | 125 |
123 // TODO(vollick): will be moved when accelerated effects are implemented. | 126 // TODO(vollick): will be moved when accelerated effects are implemented. |
124 gfx::Vector2dF source_offset; | 127 gfx::Vector2dF source_offset; |
125 gfx::Vector2dF source_to_parent; | 128 gfx::Vector2dF source_to_parent; |
126 | 129 |
127 bool operator==(const TransformNode& other) const; | 130 bool operator==(const TransformNode& other) const; |
128 | 131 |
129 void set_to_parent(const gfx::Transform& transform) { | 132 void set_to_parent(const gfx::Transform& transform) { |
130 to_parent = transform; | 133 to_parent = transform; |
131 is_invertible = to_parent.IsInvertible(); | 134 is_invertible = to_parent.IsInvertible(); |
(...skipping 25 matching lines...) Expand all Loading... |
157 | 160 |
158 bool operator==(const TransformCachedNodeData& other) const; | 161 bool operator==(const TransformCachedNodeData& other) const; |
159 | 162 |
160 void ToProtobuf(proto::TransformCachedNodeData* proto) const; | 163 void ToProtobuf(proto::TransformCachedNodeData* proto) const; |
161 void FromProtobuf(const proto::TransformCachedNodeData& proto); | 164 void FromProtobuf(const proto::TransformCachedNodeData& proto); |
162 }; | 165 }; |
163 | 166 |
164 } // namespace cc | 167 } // namespace cc |
165 | 168 |
166 #endif // CC_TREES_TRANSFORM_NODE_H_ | 169 #endif // CC_TREES_TRANSFORM_NODE_H_ |
OLD | NEW |