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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6f3f79235317488bb9b7f52dd887f3e34fad768d 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -128,10 +128,9 @@ void AddTransformNodeIfNeeded(const DataForRecursion& data_from_ancestor,
layer->should_flatten_transform() &&
!layer->parent()->should_flatten_transform();
- bool requires_node = is_root || is_scrollable || is_fixed ||
- has_significant_transform || has_animated_transform ||
- is_page_scale_application_layer || flattening_change ||
- has_surface;
+ bool requires_node = is_root || is_scrollable || has_significant_transform ||
+ has_animated_transform || has_surface ||
+ is_page_scale_application_layer || flattening_change;
Layer* transform_parent = GetTransformParent(data_from_ancestor, layer);
@@ -139,8 +138,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 !=
+ 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;
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698