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

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

Issue 2500603002: Revert of TransformTree::SetRootTransformsAndScales should set 'needs_update' on transform tree only
Patch Set: 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
« 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 720 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (root_to_screen != ToScreen(kRootNodeId)) { 741 TransformNode* root_node = Node(kRootNodeId);
742 TransformNode* root_node = Node(kRootNodeId); 742 root_node->needs_surface_contents_scale = true;
743 root_node->needs_surface_contents_scale = true; 743 root_node->surface_contents_scale = screen_space_scale;
744 root_node->surface_contents_scale = screen_space_scale; 744 SetToScreen(kRootNodeId, root_to_screen);
745 SetToScreen(kRootNodeId, root_to_screen); 745 SetFromScreen(kRootNodeId, root_from_screen);
746 SetFromScreen(kRootNodeId, root_from_screen); 746 set_needs_update(true);
747 set_needs_update(true);
748 }
749 747
750 transform.ConcatTransform(root_from_screen); 748 transform.ConcatTransform(root_from_screen);
751 TransformNode* contents_root_node = Node(kContentsRootNodeId); 749 TransformNode* contents_root_node = Node(kContentsRootNodeId);
752 if (contents_root_node->post_local != transform) { 750 if (contents_root_node->post_local != transform) {
753 contents_root_node->post_local = transform; 751 contents_root_node->post_local = transform;
754 contents_root_node->needs_local_transform_update = true; 752 contents_root_node->needs_local_transform_update = true;
755 set_needs_update(true);
756 } 753 }
757 } 754 }
758 755
759 void TransformTree::UpdateInnerViewportContainerBoundsDelta() { 756 void TransformTree::UpdateInnerViewportContainerBoundsDelta() {
760 if (nodes_affected_by_inner_viewport_bounds_delta_.empty()) 757 if (nodes_affected_by_inner_viewport_bounds_delta_.empty())
761 return; 758 return;
762 759
763 set_needs_update(true); 760 set_needs_update(true);
764 for (int i : nodes_affected_by_inner_viewport_bounds_delta_) 761 for (int i : nodes_affected_by_inner_viewport_bounds_delta_)
765 Node(i)->needs_local_transform_update = true; 762 Node(i)->needs_local_transform_update = true;
(...skipping 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after
2386 from_target.ConcatTransform(draw_transforms.from_target); 2383 from_target.ConcatTransform(draw_transforms.from_target);
2387 from_target.Scale(effect_node->surface_contents_scale.x(), 2384 from_target.Scale(effect_node->surface_contents_scale.x(),
2388 effect_node->surface_contents_scale.y()); 2385 effect_node->surface_contents_scale.y());
2389 DCHECK(from_target.ApproximatelyEqual(*transform) || 2386 DCHECK(from_target.ApproximatelyEqual(*transform) ||
2390 !draw_transforms.invertible); 2387 !draw_transforms.invertible);
2391 } 2388 }
2392 return success; 2389 return success;
2393 } 2390 }
2394 2391
2395 } // namespace cc 2392 } // 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