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

Unified Diff: cc/trees/property_tree.cc

Issue 2499683002: TransformTree::SetRootTransformsAndScales should set 'needs_update' on transform tree only if we ar… (Closed)
Patch Set: TransformTree::SetRootTransformsAndScales should set 'needs_update' on transform tree only if we ar… 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/property_tree_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 9faa616a04889f1635f3282f3b3d7c71ade3cc1f..dc1a210c0c11dc7d800a7384e1ab6bdd1e8ab53d 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -739,17 +739,20 @@ void TransformTree::SetRootTransformsAndScales(
bool invertible = root_to_screen.GetInverse(&root_from_screen);
DCHECK(invertible);
TransformNode* root_node = Node(kRootNodeId);
- root_node->needs_surface_contents_scale = true;
- root_node->surface_contents_scale = screen_space_scale;
- SetToScreen(kRootNodeId, root_to_screen);
- SetFromScreen(kRootNodeId, root_from_screen);
- set_needs_update(true);
+ if (root_node->surface_contents_scale != screen_space_scale) {
+ root_node->needs_surface_contents_scale = true;
+ root_node->surface_contents_scale = screen_space_scale;
+ SetToScreen(kRootNodeId, root_to_screen);
+ SetFromScreen(kRootNodeId, root_from_screen);
+ set_needs_update(true);
+ }
transform.ConcatTransform(root_from_screen);
TransformNode* contents_root_node = Node(kContentsRootNodeId);
if (contents_root_node->post_local != transform) {
contents_root_node->post_local = transform;
contents_root_node->needs_local_transform_update = true;
+ set_needs_update(true);
}
}
« 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