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

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

Issue 2148383005: cc: Use sublayer scale from effect tree (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 4 years, 5 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/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 11 matching lines...) Expand all
22 is_invertible(true), 22 is_invertible(true),
23 ancestors_are_invertible(true), 23 ancestors_are_invertible(true),
24 has_potential_animation(false), 24 has_potential_animation(false),
25 is_currently_animating(false), 25 is_currently_animating(false),
26 to_screen_is_potentially_animated(false), 26 to_screen_is_potentially_animated(false),
27 has_only_translation_animations(true), 27 has_only_translation_animations(true),
28 flattens_inherited_transform(false), 28 flattens_inherited_transform(false),
29 node_and_ancestors_are_flat(true), 29 node_and_ancestors_are_flat(true),
30 node_and_ancestors_have_only_integer_translation(true), 30 node_and_ancestors_have_only_integer_translation(true),
31 scrolls(false), 31 scrolls(false),
32 needs_sublayer_scale(false), 32 needs_surface_contents_scale(false),
33 affected_by_inner_viewport_bounds_delta_x(false), 33 affected_by_inner_viewport_bounds_delta_x(false),
34 affected_by_inner_viewport_bounds_delta_y(false), 34 affected_by_inner_viewport_bounds_delta_y(false),
35 affected_by_outer_viewport_bounds_delta_x(false), 35 affected_by_outer_viewport_bounds_delta_x(false),
36 affected_by_outer_viewport_bounds_delta_y(false), 36 affected_by_outer_viewport_bounds_delta_y(false),
37 in_subtree_of_page_scale_layer(false), 37 in_subtree_of_page_scale_layer(false),
38 transform_changed(false), 38 transform_changed(false),
39 post_local_scale_factor(1.0f) {} 39 post_local_scale_factor(1.0f) {}
40 40
41 TransformNode::TransformNode(const TransformNode&) = default; 41 TransformNode::TransformNode(const TransformNode&) = default;
42 42
(...skipping 13 matching lines...) Expand all
56 is_currently_animating == other.is_currently_animating && 56 is_currently_animating == other.is_currently_animating &&
57 to_screen_is_potentially_animated == 57 to_screen_is_potentially_animated ==
58 other.to_screen_is_potentially_animated && 58 other.to_screen_is_potentially_animated &&
59 has_only_translation_animations == 59 has_only_translation_animations ==
60 other.has_only_translation_animations && 60 other.has_only_translation_animations &&
61 flattens_inherited_transform == other.flattens_inherited_transform && 61 flattens_inherited_transform == other.flattens_inherited_transform &&
62 node_and_ancestors_are_flat == other.node_and_ancestors_are_flat && 62 node_and_ancestors_are_flat == other.node_and_ancestors_are_flat &&
63 node_and_ancestors_have_only_integer_translation == 63 node_and_ancestors_have_only_integer_translation ==
64 other.node_and_ancestors_have_only_integer_translation && 64 other.node_and_ancestors_have_only_integer_translation &&
65 scrolls == other.scrolls && 65 scrolls == other.scrolls &&
66 needs_sublayer_scale == other.needs_sublayer_scale && 66 needs_surface_contents_scale == other.needs_surface_contents_scale &&
67 affected_by_inner_viewport_bounds_delta_x == 67 affected_by_inner_viewport_bounds_delta_x ==
68 other.affected_by_inner_viewport_bounds_delta_x && 68 other.affected_by_inner_viewport_bounds_delta_x &&
69 affected_by_inner_viewport_bounds_delta_y == 69 affected_by_inner_viewport_bounds_delta_y ==
70 other.affected_by_inner_viewport_bounds_delta_y && 70 other.affected_by_inner_viewport_bounds_delta_y &&
71 affected_by_outer_viewport_bounds_delta_x == 71 affected_by_outer_viewport_bounds_delta_x ==
72 other.affected_by_outer_viewport_bounds_delta_x && 72 other.affected_by_outer_viewport_bounds_delta_x &&
73 affected_by_outer_viewport_bounds_delta_y == 73 affected_by_outer_viewport_bounds_delta_y ==
74 other.affected_by_outer_viewport_bounds_delta_y && 74 other.affected_by_outer_viewport_bounds_delta_y &&
75 in_subtree_of_page_scale_layer == 75 in_subtree_of_page_scale_layer ==
76 other.in_subtree_of_page_scale_layer && 76 other.in_subtree_of_page_scale_layer &&
77 transform_changed == other.transform_changed && 77 transform_changed == other.transform_changed &&
78 post_local_scale_factor == other.post_local_scale_factor && 78 post_local_scale_factor == other.post_local_scale_factor &&
79 sublayer_scale == other.sublayer_scale && 79 surface_contents_scale == other.surface_contents_scale &&
80 scroll_offset == other.scroll_offset && 80 scroll_offset == other.scroll_offset &&
81 scroll_snap == other.scroll_snap && 81 scroll_snap == other.scroll_snap &&
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
86 void TransformNode::update_pre_local_transform( 86 void TransformNode::update_pre_local_transform(
87 const gfx::Point3F& transform_origin) { 87 const gfx::Point3F& transform_origin) {
88 pre_local.MakeIdentity(); 88 pre_local.MakeIdentity();
89 pre_local.Translate3d(-transform_origin.x(), -transform_origin.y(), 89 pre_local.Translate3d(-transform_origin.x(), -transform_origin.y(),
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 data->set_to_screen_is_potentially_animated( 131 data->set_to_screen_is_potentially_animated(
132 to_screen_is_potentially_animated); 132 to_screen_is_potentially_animated);
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_needs_sublayer_scale(needs_sublayer_scale); 141 data->set_needs_surface_contents_scale(needs_surface_contents_scale);
142 142
143 data->set_affected_by_inner_viewport_bounds_delta_x( 143 data->set_affected_by_inner_viewport_bounds_delta_x(
144 affected_by_inner_viewport_bounds_delta_x); 144 affected_by_inner_viewport_bounds_delta_x);
145 data->set_affected_by_inner_viewport_bounds_delta_y( 145 data->set_affected_by_inner_viewport_bounds_delta_y(
146 affected_by_inner_viewport_bounds_delta_y); 146 affected_by_inner_viewport_bounds_delta_y);
147 data->set_affected_by_outer_viewport_bounds_delta_x( 147 data->set_affected_by_outer_viewport_bounds_delta_x(
148 affected_by_outer_viewport_bounds_delta_x); 148 affected_by_outer_viewport_bounds_delta_x);
149 data->set_affected_by_outer_viewport_bounds_delta_y( 149 data->set_affected_by_outer_viewport_bounds_delta_y(
150 affected_by_outer_viewport_bounds_delta_y); 150 affected_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 Vector2dFToProto(sublayer_scale, data->mutable_sublayer_scale()); 156 Vector2dFToProto(surface_contents_scale,
157 data->mutable_surface_contents_scale());
157 ScrollOffsetToProto(scroll_offset, data->mutable_scroll_offset()); 158 ScrollOffsetToProto(scroll_offset, data->mutable_scroll_offset());
158 Vector2dFToProto(scroll_snap, data->mutable_scroll_snap()); 159 Vector2dFToProto(scroll_snap, data->mutable_scroll_snap());
159 Vector2dFToProto(source_offset, data->mutable_source_offset()); 160 Vector2dFToProto(source_offset, data->mutable_source_offset());
160 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent()); 161 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent());
161 } 162 }
162 163
163 void TransformNode::FromProtobuf(const proto::TreeNode& proto) { 164 void TransformNode::FromProtobuf(const proto::TreeNode& proto) {
164 id = proto.id(); 165 id = proto.id();
165 parent_id = proto.parent_id(); 166 parent_id = proto.parent_id();
166 owner_id = proto.owner_id(); 167 owner_id = proto.owner_id();
(...skipping 22 matching lines...) Expand all
189 is_currently_animating = data.is_currently_animating(); 190 is_currently_animating = data.is_currently_animating();
190 to_screen_is_potentially_animated = data.to_screen_is_potentially_animated(); 191 to_screen_is_potentially_animated = data.to_screen_is_potentially_animated();
191 has_only_translation_animations = data.has_only_translation_animations(); 192 has_only_translation_animations = data.has_only_translation_animations();
192 193
193 flattens_inherited_transform = data.flattens_inherited_transform(); 194 flattens_inherited_transform = data.flattens_inherited_transform();
194 node_and_ancestors_are_flat = data.node_and_ancestors_are_flat(); 195 node_and_ancestors_are_flat = data.node_and_ancestors_are_flat();
195 196
196 node_and_ancestors_have_only_integer_translation = 197 node_and_ancestors_have_only_integer_translation =
197 data.node_and_ancestors_have_only_integer_translation(); 198 data.node_and_ancestors_have_only_integer_translation();
198 scrolls = data.scrolls(); 199 scrolls = data.scrolls();
199 needs_sublayer_scale = data.needs_sublayer_scale(); 200 needs_surface_contents_scale = data.needs_surface_contents_scale();
200 201
201 affected_by_inner_viewport_bounds_delta_x = 202 affected_by_inner_viewport_bounds_delta_x =
202 data.affected_by_inner_viewport_bounds_delta_x(); 203 data.affected_by_inner_viewport_bounds_delta_x();
203 affected_by_inner_viewport_bounds_delta_y = 204 affected_by_inner_viewport_bounds_delta_y =
204 data.affected_by_inner_viewport_bounds_delta_y(); 205 data.affected_by_inner_viewport_bounds_delta_y();
205 affected_by_outer_viewport_bounds_delta_x = 206 affected_by_outer_viewport_bounds_delta_x =
206 data.affected_by_outer_viewport_bounds_delta_x(); 207 data.affected_by_outer_viewport_bounds_delta_x();
207 affected_by_outer_viewport_bounds_delta_y = 208 affected_by_outer_viewport_bounds_delta_y =
208 data.affected_by_outer_viewport_bounds_delta_y(); 209 data.affected_by_outer_viewport_bounds_delta_y();
209 210
210 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer(); 211 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer();
211 transform_changed = data.transform_changed(); 212 transform_changed = data.transform_changed();
212 post_local_scale_factor = data.post_local_scale_factor(); 213 post_local_scale_factor = data.post_local_scale_factor();
213 214
214 sublayer_scale = ProtoToVector2dF(data.sublayer_scale()); 215 surface_contents_scale = ProtoToVector2dF(data.surface_contents_scale());
215 scroll_offset = ProtoToScrollOffset(data.scroll_offset()); 216 scroll_offset = ProtoToScrollOffset(data.scroll_offset());
216 scroll_snap = ProtoToVector2dF(data.scroll_snap()); 217 scroll_snap = ProtoToVector2dF(data.scroll_snap());
217 source_offset = ProtoToVector2dF(data.source_offset()); 218 source_offset = ProtoToVector2dF(data.source_offset());
218 source_to_parent = ProtoToVector2dF(data.source_to_parent()); 219 source_to_parent = ProtoToVector2dF(data.source_to_parent());
219 } 220 }
220 221
221 void TransformNode::AsValueInto(base::trace_event::TracedValue* value) const { 222 void TransformNode::AsValueInto(base::trace_event::TracedValue* value) const {
222 value->SetInteger("id", id); 223 value->SetInteger("id", id);
223 value->SetInteger("parent_id", parent_id); 224 value->SetInteger("parent_id", parent_id);
224 value->SetInteger("owner_id", owner_id); 225 value->SetInteger("owner_id", owner_id);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 const proto::TransformCachedNodeData& proto) { 263 const proto::TransformCachedNodeData& proto) {
263 from_target = ProtoToTransform(proto.from_target()); 264 from_target = ProtoToTransform(proto.from_target());
264 to_target = ProtoToTransform(proto.to_target()); 265 to_target = ProtoToTransform(proto.to_target());
265 from_screen = ProtoToTransform(proto.from_screen()); 266 from_screen = ProtoToTransform(proto.from_screen());
266 to_screen = ProtoToTransform(proto.to_screen()); 267 to_screen = ProtoToTransform(proto.to_screen());
267 target_id = proto.target_id(); 268 target_id = proto.target_id();
268 content_target_id = proto.content_target_id(); 269 content_target_id = proto.content_target_id();
269 } 270 }
270 271
271 } // namespace cc 272 } // 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