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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 967163002: Property tree code must account for parent offsets of fixed layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comment. Created 5 years, 10 months 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
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 0c080dd2ace2e883c98e64cbcac10a239db34d0b..0b2d3ff2977705cd205459fc9c6da862bed326c7 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -139,8 +139,21 @@ void AddTransformNodeIfNeeded(const DataForRecursion& data_from_ancestor,
gfx::Vector2dF parent_offset;
if (transform_parent) {
// TODO(vollick): This is to mimic existing bugs (crbug.com/441447).
- if (!is_fixed)
+ if (!is_fixed) {
parent_offset = transform_parent->offset_to_transform_parent();
+ } else if (data_from_ancestor.transform_tree_parent !=
enne (OOO) 2015/03/02 01:12:26 Aha!!
+ data_from_ancestor.transform_fixed_parent) {
+ gfx::Vector2dF fixed_offset = data_from_ancestor.transform_tree_parent
+ ->offset_to_transform_parent();
+ gfx::Transform parent_to_parent;
+ data_from_ancestor.transform_tree->ComputeTransform(
+ data_from_ancestor.transform_tree_parent->transform_tree_index(),
+ data_from_ancestor.transform_fixed_parent->transform_tree_index(),
+ &parent_to_parent);
+
+ fixed_offset += parent_to_parent.To2dTranslation();
+ parent_offset += fixed_offset;
+ }
gfx::Transform to_parent;
Layer* source = data_from_ancestor.transform_tree_parent;
« cc/trees/layer_tree_host_common_unittest.cc ('K') | « cc/trees/layer_tree_host_common_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698