| 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 gfx::Vector2dF screen_space_scale = | 731 gfx::Vector2dF screen_space_scale = |
| 732 MathUtil::ComputeTransform2dScaleComponents(transform, fallback_value); | 732 MathUtil::ComputeTransform2dScaleComponents(transform, fallback_value); |
| 733 DCHECK_NE(screen_space_scale.x(), 0.f); | 733 DCHECK_NE(screen_space_scale.x(), 0.f); |
| 734 DCHECK_NE(screen_space_scale.y(), 0.f); | 734 DCHECK_NE(screen_space_scale.y(), 0.f); |
| 735 | 735 |
| 736 gfx::Transform root_to_screen; | 736 gfx::Transform root_to_screen; |
| 737 root_to_screen.Scale(screen_space_scale.x(), screen_space_scale.y()); | 737 root_to_screen.Scale(screen_space_scale.x(), screen_space_scale.y()); |
| 738 gfx::Transform root_from_screen; | 738 gfx::Transform root_from_screen; |
| 739 bool invertible = root_to_screen.GetInverse(&root_from_screen); | 739 bool invertible = root_to_screen.GetInverse(&root_from_screen); |
| 740 DCHECK(invertible); | 740 DCHECK(invertible); |
| 741 TransformNode* root_node = Node(kRootNodeId); | 741 if (root_to_screen != ToScreen(kRootNodeId)) { |
| 742 root_node->needs_surface_contents_scale = true; | 742 TransformNode* root_node = Node(kRootNodeId); |
| 743 root_node->surface_contents_scale = screen_space_scale; | 743 root_node->needs_surface_contents_scale = true; |
| 744 SetToScreen(kRootNodeId, root_to_screen); | 744 root_node->surface_contents_scale = screen_space_scale; |
| 745 SetFromScreen(kRootNodeId, root_from_screen); | 745 SetToScreen(kRootNodeId, root_to_screen); |
| 746 set_needs_update(true); | 746 SetFromScreen(kRootNodeId, root_from_screen); |
| 747 set_needs_update(true); |
| 748 } |
| 747 | 749 |
| 748 transform.ConcatTransform(root_from_screen); | 750 transform.ConcatTransform(root_from_screen); |
| 749 TransformNode* contents_root_node = Node(kContentsRootNodeId); | 751 TransformNode* contents_root_node = Node(kContentsRootNodeId); |
| 750 if (contents_root_node->post_local != transform) { | 752 if (contents_root_node->post_local != transform) { |
| 751 contents_root_node->post_local = transform; | 753 contents_root_node->post_local = transform; |
| 752 contents_root_node->needs_local_transform_update = true; | 754 contents_root_node->needs_local_transform_update = true; |
| 755 set_needs_update(true); |
| 753 } | 756 } |
| 754 } | 757 } |
| 755 | 758 |
| 756 void TransformTree::UpdateInnerViewportContainerBoundsDelta() { | 759 void TransformTree::UpdateInnerViewportContainerBoundsDelta() { |
| 757 if (nodes_affected_by_inner_viewport_bounds_delta_.empty()) | 760 if (nodes_affected_by_inner_viewport_bounds_delta_.empty()) |
| 758 return; | 761 return; |
| 759 | 762 |
| 760 set_needs_update(true); | 763 set_needs_update(true); |
| 761 for (int i : nodes_affected_by_inner_viewport_bounds_delta_) | 764 for (int i : nodes_affected_by_inner_viewport_bounds_delta_) |
| 762 Node(i)->needs_local_transform_update = true; | 765 Node(i)->needs_local_transform_update = true; |
| (...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 from_target.ConcatTransform(draw_transforms.from_target); | 2386 from_target.ConcatTransform(draw_transforms.from_target); |
| 2384 from_target.Scale(effect_node->surface_contents_scale.x(), | 2387 from_target.Scale(effect_node->surface_contents_scale.x(), |
| 2385 effect_node->surface_contents_scale.y()); | 2388 effect_node->surface_contents_scale.y()); |
| 2386 DCHECK(from_target.ApproximatelyEqual(*transform) || | 2389 DCHECK(from_target.ApproximatelyEqual(*transform) || |
| 2387 !draw_transforms.invertible); | 2390 !draw_transforms.invertible); |
| 2388 } | 2391 } |
| 2389 return success; | 2392 return success; |
| 2390 } | 2393 } |
| 2391 | 2394 |
| 2392 } // namespace cc | 2395 } // namespace cc |
| OLD | NEW |