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

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

Issue 1680613002: Adding momentum/overscroll to views:: ScrollViews Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Tableview layout. aaaand I think we are done Created 4 years, 4 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') | cc/trees/tree_synchronizer_unittest.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 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 surface_contents_scale == other.surface_contents_scale && 79 surface_contents_scale == other.surface_contents_scale &&
80 scroll_offset == other.scroll_offset && 80 scroll_offset_with_overscroll == other.scroll_offset_with_overscroll &&
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(),
90 -transform_origin.z()); 90 -transform_origin.z());
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(surface_contents_scale, 156 Vector2dFToProto(surface_contents_scale,
157 data->mutable_surface_contents_scale()); 157 data->mutable_surface_contents_scale());
158 ScrollOffsetToProto(scroll_offset, data->mutable_scroll_offset()); 158 ScrollOffsetToProto(scroll_offset_with_overscroll,
159 data->mutable_scroll_offset());
159 Vector2dFToProto(scroll_snap, data->mutable_scroll_snap()); 160 Vector2dFToProto(scroll_snap, data->mutable_scroll_snap());
160 Vector2dFToProto(source_offset, data->mutable_source_offset()); 161 Vector2dFToProto(source_offset, data->mutable_source_offset());
161 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent()); 162 Vector2dFToProto(source_to_parent, data->mutable_source_to_parent());
162 } 163 }
163 164
164 void TransformNode::FromProtobuf(const proto::TreeNode& proto) { 165 void TransformNode::FromProtobuf(const proto::TreeNode& proto) {
165 id = proto.id(); 166 id = proto.id();
166 parent_id = proto.parent_id(); 167 parent_id = proto.parent_id();
167 owner_id = proto.owner_id(); 168 owner_id = proto.owner_id();
168 169
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 affected_by_outer_viewport_bounds_delta_x = 207 affected_by_outer_viewport_bounds_delta_x =
207 data.affected_by_outer_viewport_bounds_delta_x(); 208 data.affected_by_outer_viewport_bounds_delta_x();
208 affected_by_outer_viewport_bounds_delta_y = 209 affected_by_outer_viewport_bounds_delta_y =
209 data.affected_by_outer_viewport_bounds_delta_y(); 210 data.affected_by_outer_viewport_bounds_delta_y();
210 211
211 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer(); 212 in_subtree_of_page_scale_layer = data.in_subtree_of_page_scale_layer();
212 transform_changed = data.transform_changed(); 213 transform_changed = data.transform_changed();
213 post_local_scale_factor = data.post_local_scale_factor(); 214 post_local_scale_factor = data.post_local_scale_factor();
214 215
215 surface_contents_scale = ProtoToVector2dF(data.surface_contents_scale()); 216 surface_contents_scale = ProtoToVector2dF(data.surface_contents_scale());
216 scroll_offset = ProtoToScrollOffset(data.scroll_offset()); 217 scroll_offset_with_overscroll = ProtoToScrollOffset(data.scroll_offset());
217 scroll_snap = ProtoToVector2dF(data.scroll_snap()); 218 scroll_snap = ProtoToVector2dF(data.scroll_snap());
218 source_offset = ProtoToVector2dF(data.source_offset()); 219 source_offset = ProtoToVector2dF(data.source_offset());
219 source_to_parent = ProtoToVector2dF(data.source_to_parent()); 220 source_to_parent = ProtoToVector2dF(data.source_to_parent());
220 } 221 }
221 222
222 void TransformNode::AsValueInto(base::trace_event::TracedValue* value) const { 223 void TransformNode::AsValueInto(base::trace_event::TracedValue* value) const {
223 value->SetInteger("id", id); 224 value->SetInteger("id", id);
224 value->SetInteger("parent_id", parent_id); 225 value->SetInteger("parent_id", parent_id);
225 value->SetInteger("owner_id", owner_id); 226 value->SetInteger("owner_id", owner_id);
226 MathUtil::AddToTracedValue("pre_local", pre_local, value); 227 MathUtil::AddToTracedValue("pre_local", pre_local, value);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 const proto::TransformCachedNodeData& proto) { 264 const proto::TransformCachedNodeData& proto) {
264 from_target = ProtoToTransform(proto.from_target()); 265 from_target = ProtoToTransform(proto.from_target());
265 to_target = ProtoToTransform(proto.to_target()); 266 to_target = ProtoToTransform(proto.to_target());
266 from_screen = ProtoToTransform(proto.from_screen()); 267 from_screen = ProtoToTransform(proto.from_screen());
267 to_screen = ProtoToTransform(proto.to_screen()); 268 to_screen = ProtoToTransform(proto.to_screen());
268 target_id = proto.target_id(); 269 target_id = proto.target_id();
269 content_target_id = proto.content_target_id(); 270 content_target_id = proto.content_target_id();
270 } 271 }
271 272
272 } // namespace cc 273 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/transform_node.h ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698