Index: cc/trees/layer_tree_host.cc |
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc |
index 749d5e0f9fbbccf135f5a728b813601bddbd3b31..0ea11d5704ab20b93a3089d554f6441c8ce6adf7 100644 |
--- a/cc/trees/layer_tree_host.cc |
+++ b/cc/trees/layer_tree_host.cc |
@@ -1292,9 +1292,71 @@ void LayerTreeHost::ElementIsAnimatingChanged( |
ElementListType list_type, |
const PropertyAnimationState& mask, |
const PropertyAnimationState& state) { |
- Layer* layer = LayerByElementId(element_id); |
- if (layer) |
- layer->OnIsAnimatingChanged(mask, state); |
+ DCHECK_EQ(ElementListType::ACTIVE, list_type); |
+ |
+ for (int property = TargetProperty::FIRST_TARGET_PROPERTY; |
+ property <= TargetProperty::LAST_TARGET_PROPERTY; ++property) { |
+ if (!mask.currently_running[property] && |
+ !mask.potentially_animating[property]) |
+ continue; |
+ |
+ switch (property) { |
+ case TargetProperty::TRANSFORM: |
+ if (TransformNode* transform_node = |
+ property_trees()->transform_tree.FindNodeFromElementId( |
+ element_id)) { |
+ if (mask.currently_running[property]) |
+ transform_node->is_currently_animating = |
+ state.currently_running[property]; |
+ if (mask.potentially_animating[property]) { |
+ transform_node->has_potential_animation = |
+ state.potentially_animating[property]; |
+ transform_node->has_only_translation_animations = |
+ mutator_host()->HasOnlyTranslationTransforms(element_id, |
+ list_type); |
+ property_trees()->transform_tree.set_needs_update(true); |
+ } |
+ } else { |
+ DCHECK(property_trees()->needs_rebuild) |
+ << "Attempting to animate non existent transform node"; |
+ } |
+ break; |
+ case TargetProperty::OPACITY: |
+ if (EffectNode* effect_node = |
+ property_trees()->effect_tree.FindNodeFromElementId( |
+ element_id)) { |
+ if (mask.currently_running[property]) |
+ effect_node->is_currently_animating_opacity = |
+ state.currently_running[property]; |
+ if (mask.potentially_animating[property]) { |
+ effect_node->has_potential_opacity_animation = |
+ state.potentially_animating[property]; |
+ property_trees()->effect_tree.set_needs_update(true); |
+ } |
+ } else { |
+ DCHECK(property_trees()->needs_rebuild) |
+ << "Attempting to animate opacity on non existent effect node"; |
+ } |
+ break; |
+ case TargetProperty::FILTER: |
+ if (EffectNode* effect_node = |
+ property_trees()->effect_tree.FindNodeFromElementId( |
+ element_id)) { |
+ if (mask.currently_running[property]) |
+ effect_node->is_currently_animating_filter = |
+ state.currently_running[property]; |
+ if (mask.potentially_animating[property]) |
+ effect_node->has_potential_filter_animation = |
+ state.potentially_animating[property]; |
wkorman
2017/03/20 21:59:57
Double checking, this case does not have the set_n
|
+ } else { |
+ DCHECK(property_trees()->needs_rebuild) |
+ << "Attempting to animate filter on non existent effect node"; |
+ } |
+ break; |
+ default: |
+ break; |
+ } |
+ } |
} |
gfx::ScrollOffset LayerTreeHost::GetScrollOffsetForAnimation( |