| 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 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 gfx::Vector2dF screen_space_scale = | 672 gfx::Vector2dF screen_space_scale = |
| 673 MathUtil::ComputeTransform2dScaleComponents(transform, fallback_value); | 673 MathUtil::ComputeTransform2dScaleComponents(transform, fallback_value); |
| 674 DCHECK_NE(screen_space_scale.x(), 0.f); | 674 DCHECK_NE(screen_space_scale.x(), 0.f); |
| 675 DCHECK_NE(screen_space_scale.y(), 0.f); | 675 DCHECK_NE(screen_space_scale.y(), 0.f); |
| 676 | 676 |
| 677 gfx::Transform root_to_screen; | 677 gfx::Transform root_to_screen; |
| 678 root_to_screen.Scale(screen_space_scale.x(), screen_space_scale.y()); | 678 root_to_screen.Scale(screen_space_scale.x(), screen_space_scale.y()); |
| 679 gfx::Transform root_from_screen; | 679 gfx::Transform root_from_screen; |
| 680 bool invertible = root_to_screen.GetInverse(&root_from_screen); | 680 bool invertible = root_to_screen.GetInverse(&root_from_screen); |
| 681 DCHECK(invertible); | 681 DCHECK(invertible); |
| 682 SetToScreen(kRootNodeId, root_to_screen); | 682 if (root_to_screen != ToScreen(kRootNodeId)) { |
| 683 SetFromScreen(kRootNodeId, root_from_screen); | 683 SetToScreen(kRootNodeId, root_to_screen); |
| 684 set_needs_update(true); | 684 SetFromScreen(kRootNodeId, root_from_screen); |
| 685 set_needs_update(true); |
| 686 } |
| 685 | 687 |
| 686 transform.ConcatTransform(root_from_screen); | 688 transform.ConcatTransform(root_from_screen); |
| 687 TransformNode* contents_root_node = Node(kContentsRootNodeId); | 689 TransformNode* contents_root_node = Node(kContentsRootNodeId); |
| 688 if (contents_root_node->post_local != transform) { | 690 if (contents_root_node->post_local != transform) { |
| 689 contents_root_node->post_local = transform; | 691 contents_root_node->post_local = transform; |
| 690 contents_root_node->needs_local_transform_update = true; | 692 contents_root_node->needs_local_transform_update = true; |
| 693 set_needs_update(true); |
| 691 } | 694 } |
| 692 } | 695 } |
| 693 | 696 |
| 694 void TransformTree::UpdateInnerViewportContainerBoundsDelta() { | 697 void TransformTree::UpdateInnerViewportContainerBoundsDelta() { |
| 695 if (nodes_affected_by_inner_viewport_bounds_delta_.empty()) | 698 if (nodes_affected_by_inner_viewport_bounds_delta_.empty()) |
| 696 return; | 699 return; |
| 697 | 700 |
| 698 set_needs_update(true); | 701 set_needs_update(true); |
| 699 for (int i : nodes_affected_by_inner_viewport_bounds_delta_) | 702 for (int i : nodes_affected_by_inner_viewport_bounds_delta_) |
| 700 Node(i)->needs_local_transform_update = true; | 703 Node(i)->needs_local_transform_update = true; |
| (...skipping 1519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2220 | 2223 |
| 2221 const EffectNode* effect_node = effect_tree.Node(effect_id); | 2224 const EffectNode* effect_node = effect_tree.Node(effect_id); |
| 2222 | 2225 |
| 2223 bool success = GetFromTarget(transform_id, effect_id, transform); | 2226 bool success = GetFromTarget(transform_id, effect_id, transform); |
| 2224 transform->Scale(effect_node->surface_contents_scale.x(), | 2227 transform->Scale(effect_node->surface_contents_scale.x(), |
| 2225 effect_node->surface_contents_scale.y()); | 2228 effect_node->surface_contents_scale.y()); |
| 2226 return success; | 2229 return success; |
| 2227 } | 2230 } |
| 2228 | 2231 |
| 2229 } // namespace cc | 2232 } // namespace cc |
| OLD | NEW |