Index: cc/animation/animation_player.cc |
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc |
index b98e9388ae5d5dca72e84687ee509c9d13ccf962..aa99e8ad20ece7a76ed487ccfbf5482adb0c58ea 100644 |
--- a/cc/animation/animation_player.cc |
+++ b/cc/animation/animation_player.cc |
@@ -9,6 +9,7 @@ |
#include "cc/animation/animation_delegate.h" |
#include "cc/animation/animation_host.h" |
#include "cc/animation/animation_timeline.h" |
+#include "cc/animation/property_animation_state.h" |
#include "cc/animation/scroll_offset_animation_curve.h" |
namespace cc { |
@@ -995,6 +996,26 @@ Animation* AnimationPlayer::GetAnimationById(int animation_id) const { |
return nullptr; |
} |
+void AnimationPlayer::GetPropertyAnimationStateFor( |
+ TargetProperty::Type property, |
+ PropertyAnimationState* state) const { |
+ state->Clear(); |
+ for (const auto& animation : animations_) { |
+ if (!animation->is_finished() && animation->target_property() == property) { |
+ state->potentially_animating_for_active_elements |= |
+ animation->affects_active_elements(); |
+ state->potentially_animating_for_pending_elements |= |
+ animation->affects_pending_elements(); |
+ state->currently_running_for_active_elements |= |
+ animation->affects_active_elements() && |
+ animation->InEffect(last_tick_time_); |
+ state->currently_running_for_pending_elements |= |
+ animation->affects_pending_elements() && |
+ animation->InEffect(last_tick_time_); |
+ } |
+ } |
+} |
+ |
void AnimationPlayer::MarkAbortedAnimationsForDeletion( |
AnimationPlayer* animation_player_impl) const { |
bool aborted_transform_animation = false; |