Chromium Code Reviews| Index: cc/trees/property_tree_builder.cc |
| diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc |
| index 6d9c2f20c70effbfdc49a256683c9e7e55980cfb..a16033d71ab8341242dae60ad7f9d43364ee21db 100644 |
| --- a/cc/trees/property_tree_builder.cc |
| +++ b/cc/trees/property_tree_builder.cc |
| @@ -767,6 +767,14 @@ static inline float Opacity(LayerImpl* layer) { |
| return layer->test_properties()->opacity; |
| } |
| +static inline const FilterOperations& Filters(Layer* layer) { |
| + return layer->filters(); |
| +} |
| + |
| +static inline const FilterOperations& Filters(LayerImpl* layer) { |
| + return layer->test_properties()->filters; |
| +} |
| + |
| static inline const FilterOperations& BackgroundFilters(Layer* layer) { |
| return layer->background_filters(); |
| } |
| @@ -822,7 +830,7 @@ bool ShouldCreateRenderSurface(LayerType* layer, |
| } |
| // If the layer uses a CSS filter. |
| - if (!layer->filters().IsEmpty() || !BackgroundFilters(layer).IsEmpty()) { |
| + if (!Filters(layer).IsEmpty() || !BackgroundFilters(layer).IsEmpty()) { |
| return true; |
| } |
| @@ -928,15 +936,17 @@ bool AddEffectNodeIfNeeded( |
| const bool has_transparency = EffectiveOpacity(layer) != 1.f; |
| const bool has_potential_opacity_animation = |
| HasPotentialOpacityAnimation(layer); |
| + const bool has_potential_filter_animation = |
| + HasPotentiallyRunningFilterAnimation(layer); |
| const bool should_create_render_surface = ShouldCreateRenderSurface( |
| layer, data_from_ancestor.compound_transform_since_render_target, |
| data_from_ancestor.axis_align_since_render_target); |
| data_for_children->axis_align_since_render_target &= |
| AnimationsPreserveAxisAlignment(layer); |
| - bool requires_node = is_root || has_transparency || |
| - has_potential_opacity_animation || |
| - should_create_render_surface; |
| + bool requires_node = |
| + is_root || has_transparency || has_potential_opacity_animation || |
| + has_potential_filter_animation || should_create_render_surface; |
|
jaydasika
2016/07/20 20:53:06
Is this condition required ? Doesn't has_potential
ajuma
2016/07/21 16:42:18
Done. (It's surprising that has_potential_opacity_
jaydasika
2016/07/21 17:22:35
It sounds like a bug to me. For the case, current
ajuma
2016/07/21 18:49:41
Yeah, it's a bug. I'll fix it in a separate CL.
I
|
| int parent_id = data_from_ancestor.effect_tree_parent; |
| @@ -958,11 +968,14 @@ bool AddEffectNodeIfNeeded( |
| node.opacity = Opacity(layer); |
| node.has_render_surface = should_create_render_surface; |
| node.has_copy_request = HasCopyRequest(layer); |
| + node.filters = Filters(layer); |
|
weiliangc
2016/07/21 01:06:38
This would make a copy of the Filter owned by Laye
ajuma
2016/07/21 16:42:18
If we transfer ownership rather than copying, we'l
|
| node.background_filters = BackgroundFilters(layer); |
| node.has_potential_opacity_animation = has_potential_opacity_animation; |
| + node.has_potential_filter_animation = has_potential_filter_animation; |
| node.double_sided = DoubleSided(layer); |
| node.subtree_hidden = HideLayerAndSubtree(layer); |
| node.is_currently_animating_opacity = OpacityIsAnimating(layer); |
| + node.is_currently_animating_filter = FilterIsAnimating(layer); |
| EffectTree& effect_tree = data_for_children->property_trees->effect_tree; |
| if (MaskLayer(layer)) { |