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 "cc/trees/property_tree_builder.h" | 5 #include "cc/trees/property_tree_builder.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "cc/base/math_util.h" | 10 #include "cc/base/math_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 const bool has_animated_transform = | 121 const bool has_animated_transform = |
122 layer->layer_animation_controller()->IsAnimatingProperty( | 122 layer->layer_animation_controller()->IsAnimatingProperty( |
123 Animation::TRANSFORM); | 123 Animation::TRANSFORM); |
124 | 124 |
125 const bool has_surface = !!layer->render_surface(); | 125 const bool has_surface = !!layer->render_surface(); |
126 | 126 |
127 const bool flattening_change = layer->parent() && | 127 const bool flattening_change = layer->parent() && |
128 layer->should_flatten_transform() && | 128 layer->should_flatten_transform() && |
129 !layer->parent()->should_flatten_transform(); | 129 !layer->parent()->should_flatten_transform(); |
130 | 130 |
131 bool requires_node = is_root || is_scrollable || is_fixed || | 131 bool requires_node = is_root || is_scrollable || has_significant_transform || |
132 has_significant_transform || has_animated_transform || | 132 has_animated_transform || has_surface || |
133 is_page_scale_application_layer || flattening_change || | 133 is_page_scale_application_layer || flattening_change; |
134 has_surface; | |
135 | 134 |
136 Layer* transform_parent = GetTransformParent(data_from_ancestor, layer); | 135 Layer* transform_parent = GetTransformParent(data_from_ancestor, layer); |
137 | 136 |
138 // May be non-zero if layer is fixed or has a scroll parent. | 137 // May be non-zero if layer is fixed or has a scroll parent. |
139 gfx::Vector2dF parent_offset; | 138 gfx::Vector2dF parent_offset; |
140 if (transform_parent) { | 139 if (transform_parent) { |
141 // TODO(vollick): This is to mimic existing bugs (crbug.com/441447). | 140 // TODO(vollick): This is to mimic existing bugs (crbug.com/441447). |
142 if (!is_fixed) | 141 if (!is_fixed) |
143 parent_offset = transform_parent->offset_to_transform_parent(); | 142 parent_offset = transform_parent->offset_to_transform_parent(); |
144 | 143 |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 data_for_recursion.device_transform = &device_transform; | 306 data_for_recursion.device_transform = &device_transform; |
308 | 307 |
309 ClipNode root_clip; | 308 ClipNode root_clip; |
310 root_clip.data.clip = viewport; | 309 root_clip.data.clip = viewport; |
311 root_clip.data.transform_id = 0; | 310 root_clip.data.transform_id = 0; |
312 data_for_recursion.clip_tree_parent = clip_tree->Insert(root_clip, 0); | 311 data_for_recursion.clip_tree_parent = clip_tree->Insert(root_clip, 0); |
313 BuildPropertyTreesInternal(root_layer, data_for_recursion); | 312 BuildPropertyTreesInternal(root_layer, data_for_recursion); |
314 } | 313 } |
315 | 314 |
316 } // namespace cc | 315 } // namespace cc |
OLD | NEW |