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

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

Issue 2486393006: Include the source_to_parent offset when removing offset applied by main. (Closed)
Patch Set: Add unit test LayerTreeHostCommonTest.StickyPositionTopScrollParent 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
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 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 float top_delta = std::max<float>( 467 float top_delta = std::max<float>(
468 0, 468 0,
469 top_limit - constraint.scroll_container_relative_sticky_box_rect.y()); 469 top_limit - constraint.scroll_container_relative_sticky_box_rect.y());
470 float available_space = std::max<float>( 470 float available_space = std::max<float>(
471 0, constraint.scroll_container_relative_containing_block_rect.bottom() - 471 0, constraint.scroll_container_relative_containing_block_rect.bottom() -
472 constraint.scroll_container_relative_sticky_box_rect.bottom()); 472 constraint.scroll_container_relative_sticky_box_rect.bottom());
473 if (top_delta > available_space) 473 if (top_delta > available_space)
474 top_delta = available_space; 474 top_delta = available_space;
475 sticky_offset.set_y(sticky_offset.y() + top_delta); 475 sticky_offset.set_y(sticky_offset.y() + top_delta);
476 } 476 }
477 return sticky_offset - layer_offset - 477 return sticky_offset - layer_offset - node->source_to_parent -
478 constraint.scroll_container_relative_sticky_box_rect 478 constraint.scroll_container_relative_sticky_box_rect
479 .OffsetFromOrigin(); 479 .OffsetFromOrigin();
480 } 480 }
481 481
482 void TransformTree::UpdateLocalTransform(TransformNode* node) { 482 void TransformTree::UpdateLocalTransform(TransformNode* node) {
483 gfx::Transform transform = node->post_local; 483 gfx::Transform transform = node->post_local;
484 if (NeedsSourceToParentUpdate(node)) { 484 if (NeedsSourceToParentUpdate(node)) {
485 gfx::Transform to_parent; 485 gfx::Transform to_parent;
486 ComputeTranslation(node->source_node_id, node->parent_id, &to_parent); 486 ComputeTranslation(node->source_node_id, node->parent_id, &to_parent);
487 gfx::Vector2dF unsnapping; 487 gfx::Vector2dF unsnapping;
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
2220 2220
2221 const EffectNode* effect_node = effect_tree.Node(effect_id); 2221 const EffectNode* effect_node = effect_tree.Node(effect_id);
2222 2222
2223 bool success = GetFromTarget(transform_id, effect_id, transform); 2223 bool success = GetFromTarget(transform_id, effect_id, transform);
2224 transform->Scale(effect_node->surface_contents_scale.x(), 2224 transform->Scale(effect_node->surface_contents_scale.x(),
2225 effect_node->surface_contents_scale.y()); 2225 effect_node->surface_contents_scale.y());
2226 return success; 2226 return success;
2227 } 2227 }
2228 2228
2229 } // namespace cc 2229 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698