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

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

Issue 2183923002: Undo scroll snaps in to_parent when NeedsSourceToParentUpdate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | cc/trees/property_tree_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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 bool all_are_invertible = dest_to_source.GetInverse(&source_to_dest); 321 bool all_are_invertible = dest_to_source.GetInverse(&source_to_dest);
322 transform->PreconcatTransform(source_to_dest); 322 transform->PreconcatTransform(source_to_dest);
323 return all_are_invertible; 323 return all_are_invertible;
324 } 324 }
325 325
326 void TransformTree::UpdateLocalTransform(TransformNode* node) { 326 void TransformTree::UpdateLocalTransform(TransformNode* node) {
327 gfx::Transform transform = node->post_local; 327 gfx::Transform transform = node->post_local;
328 if (NeedsSourceToParentUpdate(node)) { 328 if (NeedsSourceToParentUpdate(node)) {
329 gfx::Transform to_parent; 329 gfx::Transform to_parent;
330 ComputeTransform(node->source_node_id, node->parent_id, &to_parent); 330 ComputeTransform(node->source_node_id, node->parent_id, &to_parent);
331 gfx::Vector2dF unsnapping;
332 TransformNode* current;
333 for (current = Node(node->source_node_id); current->id > node->parent_id;
334 current = parent(current))
335 unsnapping.Subtract(current->scroll_snap);
336 for (TransformNode* parent_node = Node(node->parent_id);
337 parent_node->id >= current->id; parent_node = parent(parent_node))
338 unsnapping.Subtract(parent_node->scroll_snap);
ajuma 2016/07/26 19:34:41 This is the right general approach, but I think th
339 to_parent.Translate(unsnapping.x(), unsnapping.y());
331 node->source_to_parent = to_parent.To2dTranslation(); 340 node->source_to_parent = to_parent.To2dTranslation();
332 } 341 }
333 342
334 gfx::Vector2dF fixed_position_adjustment; 343 gfx::Vector2dF fixed_position_adjustment;
335 gfx::Vector2dF inner_viewport_bounds_delta = 344 gfx::Vector2dF inner_viewport_bounds_delta =
336 property_trees()->inner_viewport_container_bounds_delta(); 345 property_trees()->inner_viewport_container_bounds_delta();
337 gfx::Vector2dF outer_viewport_bounds_delta = 346 gfx::Vector2dF outer_viewport_bounds_delta =
338 property_trees()->outer_viewport_container_bounds_delta(); 347 property_trees()->outer_viewport_container_bounds_delta();
339 if (node->affected_by_inner_viewport_bounds_delta_x) 348 if (node->affected_by_inner_viewport_bounds_delta_x)
340 fixed_position_adjustment.set_x(inner_viewport_bounds_delta.x()); 349 fixed_position_adjustment.set_x(inner_viewport_bounds_delta.x());
(...skipping 1637 matching lines...) Expand 10 before | Expand all | Expand 10 after
1978 if (transform_id > destination_transform_id) { 1987 if (transform_id > destination_transform_id) {
1979 return transform_tree.CombineTransformsBetween( 1988 return transform_tree.CombineTransformsBetween(
1980 transform_id, destination_transform_id, transform); 1989 transform_id, destination_transform_id, transform);
1981 } 1990 }
1982 1991
1983 return transform_tree.CombineInversesBetween( 1992 return transform_tree.CombineInversesBetween(
1984 transform_id, destination_transform_id, transform); 1993 transform_id, destination_transform_id, transform);
1985 } 1994 }
1986 1995
1987 } // namespace cc 1996 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698