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

Unified Diff: cc/animation/animation_player.cc

Issue 2349643003: CC Animation: Extract PropertyAnimationState as a non-nested struct. (Closed)
Patch Set: Reparent to master to make it independent. Created 4 years, 2 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
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « cc/animation/animation_player.h ('k') | cc/animation/element_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698