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

Unified Diff: cc/animation/animation_player.cc

Issue 2349643003: CC Animation: Extract PropertyAnimationState as a non-nested struct. (Closed)
Patch Set: Created 4 years, 3 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
Index: cc/animation/animation_player.cc
diff --git a/cc/animation/animation_player.cc b/cc/animation/animation_player.cc
index 196bad0a89e1c2ea2fe61c2c018c91dd7b924c67..01ba0125121d7c0dd4d38eb654514ebf9cb89755 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 {
@@ -1010,6 +1011,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;

Powered by Google App Engine
This is Rietveld 408576698