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

Side by Side Diff: cc/trees/transform_node.cc

Issue 2451183002: Add sticky nodes affected by inner and outer viewport bounds deltas. (Closed)
Patch Set: Merge with master. Created 4 years, 1 month 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/trees/transform_node.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "base/trace_event/trace_event_argument.h" 5 #include "base/trace_event/trace_event_argument.h"
6 #include "cc/base/math_util.h" 6 #include "cc/base/math_util.h"
7 #include "cc/proto/gfx_conversions.h" 7 #include "cc/proto/gfx_conversions.h"
8 #include "cc/proto/property_tree.pb.h" 8 #include "cc/proto/property_tree.pb.h"
9 #include "cc/trees/transform_node.h" 9 #include "cc/trees/transform_node.h"
10 #include "ui/gfx/geometry/point3_f.h" 10 #include "ui/gfx/geometry/point3_f.h"
(...skipping 13 matching lines...) Expand all
24 ancestors_are_invertible(true), 24 ancestors_are_invertible(true),
25 has_potential_animation(false), 25 has_potential_animation(false),
26 is_currently_animating(false), 26 is_currently_animating(false),
27 to_screen_is_potentially_animated(false), 27 to_screen_is_potentially_animated(false),
28 has_only_translation_animations(true), 28 has_only_translation_animations(true),
29 flattens_inherited_transform(false), 29 flattens_inherited_transform(false),
30 node_and_ancestors_are_flat(true), 30 node_and_ancestors_are_flat(true),
31 node_and_ancestors_have_only_integer_translation(true), 31 node_and_ancestors_have_only_integer_translation(true),
32 scrolls(false), 32 scrolls(false),
33 should_be_snapped(false), 33 should_be_snapped(false),
34 affected_by_inner_viewport_bounds_delta_x(false), 34 moved_by_inner_viewport_bounds_delta_x(false),
35 affected_by_inner_viewport_bounds_delta_y(false), 35 moved_by_inner_viewport_bounds_delta_y(false),
36 affected_by_outer_viewport_bounds_delta_x(false), 36 moved_by_outer_viewport_bounds_delta_x(false),
37 affected_by_outer_viewport_bounds_delta_y(false), 37 moved_by_outer_viewport_bounds_delta_y(false),
38 in_subtree_of_page_scale_layer(false), 38 in_subtree_of_page_scale_layer(false),
39 transform_changed(false), 39 transform_changed(false),
40 post_local_scale_factor(1.0f) {} 40 post_local_scale_factor(1.0f) {}
41 41
42 TransformNode::TransformNode(const TransformNode&) = default; 42 TransformNode::TransformNode(const TransformNode&) = default;
43 43
44 bool TransformNode::operator==(const TransformNode& other) const { 44 bool TransformNode::operator==(const TransformNode& other) const {
45 return id == other.id && parent_id == other.parent_id && 45 return id == other.id && parent_id == other.parent_id &&
46 owner_id == other.owner_id && pre_local == other.pre_local && 46 owner_id == other.owner_id && pre_local == other.pre_local &&
47 local == other.local && post_local == other.post_local && 47 local == other.local && post_local == other.post_local &&
(...skipping 10 matching lines...) Expand all
58 to_screen_is_potentially_animated == 58 to_screen_is_potentially_animated ==
59 other.to_screen_is_potentially_animated && 59 other.to_screen_is_potentially_animated &&
60 has_only_translation_animations == 60 has_only_translation_animations ==
61 other.has_only_translation_animations && 61 other.has_only_translation_animations &&
62 flattens_inherited_transform == other.flattens_inherited_transform && 62 flattens_inherited_transform == other.flattens_inherited_transform &&
63 node_and_ancestors_are_flat == other.node_and_ancestors_are_flat && 63 node_and_ancestors_are_flat == other.node_and_ancestors_are_flat &&
64 node_and_ancestors_have_only_integer_translation == 64 node_and_ancestors_have_only_integer_translation ==
65 other.node_and_ancestors_have_only_integer_translation && 65 other.node_and_ancestors_have_only_integer_translation &&
66 scrolls == other.scrolls && 66 scrolls == other.scrolls &&
67 should_be_snapped == other.should_be_snapped && 67 should_be_snapped == other.should_be_snapped &&
68 affected_by_inner_viewport_bounds_delta_x == 68 moved_by_inner_viewport_bounds_delta_x ==
69 other.affected_by_inner_viewport_bounds_delta_x && 69 other.moved_by_inner_viewport_bounds_delta_x &&
70 affected_by_inner_viewport_bounds_delta_y == 70 moved_by_inner_viewport_bounds_delta_y ==
71 other.affected_by_inner_viewport_bounds_delta_y && 71 other.moved_by_inner_viewport_bounds_delta_y &&
72 affected_by_outer_viewport_bounds_delta_x == 72 moved_by_outer_viewport_bounds_delta_x ==
73 other.affected_by_outer_viewport_bounds_delta_x && 73 other.moved_by_outer_viewport_bounds_delta_x &&
74 affected_by_outer_viewport_bounds_delta_y == 74 moved_by_outer_viewport_bounds_delta_y ==
75 other.affected_by_outer_viewport_bounds_delta_y && 75 other.moved_by_outer_viewport_bounds_delta_y &&
76 in_subtree_of_page_scale_layer == 76 in_subtree_of_page_scale_layer ==
77 other.in_subtree_of_page_scale_layer && 77 other.in_subtree_of_page_scale_layer &&
78 transform_changed == other.transform_changed && 78 transform_changed == other.transform_changed &&
79 post_local_scale_factor == other.post_local_scale_factor && 79 post_local_scale_factor == other.post_local_scale_factor &&
80 scroll_offset == other.scroll_offset && 80 scroll_offset == other.scroll_offset &&
81 snap_amount == other.snap_amount && 81 snap_amount == other.snap_amount &&
82 source_offset == other.source_offset && 82 source_offset == other.source_offset &&
83 source_to_parent == other.source_to_parent; 83 source_to_parent == other.source_to_parent;
84 } 84 }
85 85
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 data->set_has_only_translation_animations(has_only_translation_animations); 133 data->set_has_only_translation_animations(has_only_translation_animations);
134 134
135 data->set_flattens_inherited_transform(flattens_inherited_transform); 135 data->set_flattens_inherited_transform(flattens_inherited_transform);
136 data->set_node_and_ancestors_are_flat(node_and_ancestors_are_flat); 136 data->set_node_and_ancestors_are_flat(node_and_ancestors_are_flat);
137 137
138 data->set_node_and_ancestors_have_only_integer_translation( 138 data->set_node_and_ancestors_have_only_integer_translation(
139 node_and_ancestors_have_only_integer_translation); 139 node_and_ancestors_have_only_integer_translation);
140 data->set_scrolls(scrolls); 140 data->set_scrolls(scrolls);
141 data->set_should_be_snapped(should_be_snapped); 141 data->set_should_be_snapped(should_be_snapped);
142 142
143 data->set_affected_by_inner_viewport_bounds_delta_x( 143 data->set_moved_by_inner_viewport_bounds_delta_x(
144 affected_by_inner_viewport_bounds_delta_x); 144 moved_by_inner_viewport_bounds_delta_x);
145 data->set_affected_by_inner_viewport_bounds_delta_y( 145 data->set_moved_by_inner_viewport_bounds_delta_y(
146 affected_by_inner_viewport_bounds_delta_y); 146 moved_by_inner_viewport_bounds_delta_y);
147 data->set_affected_by_outer_viewport_bounds_delta_x( 147 data->set_moved_by_outer_viewport_bounds_delta_x(
148 affected_by_outer_viewport_bounds_delta_x); 148 moved_by_outer_viewport_bounds_delta_x);
149 data->set_affected_by_outer_viewport_bounds_delta_y( 149 data->set_moved_by_outer_viewport_bounds_delta_y(
150 affected_by_outer_viewport_bounds_delta_y); 150 moved_by_outer_viewport_bounds_delta_y);
151 151
152 data->set_in_subtree_of_page_scale_layer(in_subtree_of_page_scale_layer); 152 data->set_in_subtree_of_page_scale_layer(in_subtree_of_page_scale_layer);
153 data->set_transform_changed(transform_changed); 153 data->set_transform_changed(transform_changed);
154 data->set_post_local_scale_factor(post_local_scale_factor); 154 data->set_post_local_scale_factor(post_local_scale_factor);
155 155
156 ScrollOffsetToProto(scroll_offset, data->mutable_scroll_offset()); 156 ScrollOffsetToProto(scroll_offset, data->mutable_scroll_offset());
157 Vector2dFToProto(snap_amount, data->mutable_snap_amount()); 157 Vector2dFToProto(snap_amount, data->mutable_snap_amount());
158 Vector2dFToProto(source_offset, data->mutable_source_offset()); 158 Vector2dFToProto(source_offset, data->mutable_source_offset());
159 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent()); 159 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent());
160 } 160 }
(...skipping 29 matching lines...) Expand all
190 has_only_translation_animations = data.has_only_translation_animations(); 190 has_only_translation_animations = data.has_only_translation_animations();
191 191
192 flattens_inherited_transform = data.flattens_inherited_transform(); 192 flattens_inherited_transform = data.flattens_inherited_transform();
193 node_and_ancestors_are_flat = data.node_and_ancestors_are_flat(); 193 node_and_ancestors_are_flat = data.node_and_ancestors_are_flat();
194 194
195 node_and_ancestors_have_only_integer_translation = 195 node_and_ancestors_have_only_integer_translation =
196 data.node_and_ancestors_have_only_integer_translation(); 196 data.node_and_ancestors_have_only_integer_translation();
197 scrolls = data.scrolls(); 197 scrolls = data.scrolls();
198 should_be_snapped = data.should_be_snapped(); 198 should_be_snapped = data.should_be_snapped();
199 199
200 affected_by_inner_viewport_bounds_delta_x = 200 moved_by_inner_viewport_bounds_delta_x =
201 data.affected_by_inner_viewport_bounds_delta_x(); 201 data.moved_by_inner_viewport_bounds_delta_x();
202 affected_by_inner_viewport_bounds_delta_y = 202 moved_by_inner_viewport_bounds_delta_y =
203 data.affected_by_inner_viewport_bounds_delta_y(); 203 data.moved_by_inner_viewport_bounds_delta_y();
204 affected_by_outer_viewport_bounds_delta_x = 204 moved_by_outer_viewport_bounds_delta_x =
205 data.affected_by_outer_viewport_bounds_delta_x(); 205 data.moved_by_outer_viewport_bounds_delta_x();
206 affected_by_outer_viewport_bounds_delta_y = 206 moved_by_outer_viewport_bounds_delta_y =
207 data.affected_by_outer_viewport_bounds_delta_y(); 207 data.moved_by_outer_viewport_bounds_delta_y();
208 208
209 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer(); 209 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer();
210 transform_changed = data.transform_changed(); 210 transform_changed = data.transform_changed();
211 post_local_scale_factor = data.post_local_scale_factor(); 211 post_local_scale_factor = data.post_local_scale_factor();
212 212
213 scroll_offset = ProtoToScrollOffset(data.scroll_offset()); 213 scroll_offset = ProtoToScrollOffset(data.scroll_offset());
214 snap_amount = ProtoToVector2dF(data.snap_amount()); 214 snap_amount = ProtoToVector2dF(data.snap_amount());
215 source_offset = ProtoToVector2dF(data.source_offset()); 215 source_offset = ProtoToVector2dF(data.source_offset());
216 source_to_parent = ProtoToVector2dF(data.source_to_parent()); 216 source_to_parent = ProtoToVector2dF(data.source_to_parent());
217 } 217 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 257
258 void TransformCachedNodeData::FromProtobuf( 258 void TransformCachedNodeData::FromProtobuf(
259 const proto::TransformCachedNodeData& proto) { 259 const proto::TransformCachedNodeData& proto) {
260 from_screen = ProtoToTransform(proto.from_screen()); 260 from_screen = ProtoToTransform(proto.from_screen());
261 to_screen = ProtoToTransform(proto.to_screen()); 261 to_screen = ProtoToTransform(proto.to_screen());
262 target_id = proto.target_id(); 262 target_id = proto.target_id();
263 content_target_id = proto.content_target_id(); 263 content_target_id = proto.content_target_id();
264 } 264 }
265 265
266 } // namespace cc 266 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/transform_node.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698