OLD | NEW |
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 sticky_offset.set_y(sticky_offset.y() + top_delta); | 450 sticky_offset.set_y(sticky_offset.y() + top_delta); |
451 } | 451 } |
452 | 452 |
453 sticky_data->total_sticky_box_sticky_offset = | 453 sticky_data->total_sticky_box_sticky_offset = |
454 ancestor_sticky_box_offset + sticky_offset - | 454 ancestor_sticky_box_offset + sticky_offset - |
455 sticky_box_rect.OffsetFromOrigin(); | 455 sticky_box_rect.OffsetFromOrigin(); |
456 sticky_data->total_containing_block_sticky_offset = | 456 sticky_data->total_containing_block_sticky_offset = |
457 ancestor_sticky_box_offset + ancestor_containing_block_offset + | 457 ancestor_sticky_box_offset + ancestor_containing_block_offset + |
458 sticky_offset - sticky_box_rect.OffsetFromOrigin(); | 458 sticky_offset - sticky_box_rect.OffsetFromOrigin(); |
459 | 459 |
460 return sticky_offset - layer_offset - node->source_to_parent - | 460 return sticky_offset - layer_offset - sticky_box_rect.OffsetFromOrigin() - |
461 sticky_box_rect.OffsetFromOrigin(); | 461 ((node->source_node_id != node->parent_id) |
| 462 ? node->source_offset + node->source_to_parent |
| 463 : gfx::Vector2dF()); |
462 } | 464 } |
463 | 465 |
464 void TransformTree::UpdateLocalTransform(TransformNode* node) { | 466 void TransformTree::UpdateLocalTransform(TransformNode* node) { |
465 gfx::Transform transform = node->post_local; | 467 gfx::Transform transform = node->post_local; |
466 if (NeedsSourceToParentUpdate(node)) { | 468 if (NeedsSourceToParentUpdate(node)) { |
467 gfx::Transform to_parent; | 469 gfx::Transform to_parent; |
468 ComputeTranslation(node->source_node_id, node->parent_id, &to_parent); | 470 ComputeTranslation(node->source_node_id, node->parent_id, &to_parent); |
469 gfx::Vector2dF unsnapping; | 471 gfx::Vector2dF unsnapping; |
470 TransformNode* current; | 472 TransformNode* current; |
471 TransformNode* parent_node; | 473 TransformNode* parent_node; |
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2102 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2104 const EffectNode* effect_node = effect_tree.Node(effect_id); |
2103 | 2105 |
2104 if (effect_node->surface_contents_scale.x() != 0.0 && | 2106 if (effect_node->surface_contents_scale.x() != 0.0 && |
2105 effect_node->surface_contents_scale.y() != 0.0) | 2107 effect_node->surface_contents_scale.y() != 0.0) |
2106 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), | 2108 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), |
2107 1.0 / effect_node->surface_contents_scale.y()); | 2109 1.0 / effect_node->surface_contents_scale.y()); |
2108 return screen_space_transform; | 2110 return screen_space_transform; |
2109 } | 2111 } |
2110 | 2112 |
2111 } // namespace cc | 2113 } // namespace cc |
OLD | NEW |