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

Unified Diff: ui/compositor/layer_animator.cc

Issue 1898683002: CC Animation: Erase LayerAnimationEventObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eventobserver
Patch Set: Created 4 years, 8 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 | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animator.cc
diff --git a/ui/compositor/layer_animator.cc b/ui/compositor/layer_animator.cc
index 113e4d0ae85adc8f9d922f9a659024779fddd024..d7c36da5195748b802eda823ed7a17e310f09674 100644
--- a/ui/compositor/layer_animator.cc
+++ b/ui/compositor/layer_animator.cc
@@ -10,7 +10,6 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
-#include "cc/animation/animation_events.h"
#include "cc/animation/animation_host.h"
#include "cc/animation/animation_id_provider.h"
#include "cc/animation/animation_player.h"
@@ -196,13 +195,11 @@ void LayerAnimator::AttachLayerToAnimationPlayer(int layer_id) {
else
DCHECK_EQ(animation_player_->layer_id(), layer_id);
- if (animation_player_->element_animations())
- animation_player_->element_animations()->SetEventObserver(this);
+ animation_player_->set_layer_animation_delegate(this);
}
void LayerAnimator::DetachLayerFromAnimationPlayer() {
- if (animation_player_->element_animations())
- animation_player_->element_animations()->SetEventObserver(nullptr);
+ animation_player_->set_layer_animation_delegate(nullptr);
if (animation_player_->layer_id())
animation_player_->DetachLayer();
@@ -405,23 +402,26 @@ void LayerAnimator::RemoveObserver(LayerAnimationObserver* observer) {
}
void LayerAnimator::OnThreadedAnimationStarted(
- const cc::AnimationEvent& event) {
+ base::TimeTicks monotonic_time,
+ cc::TargetProperty::Type target_property,
+ int group_id) {
LayerAnimationElement::AnimatableProperty property =
- LayerAnimationElement::ToAnimatableProperty(event.target_property);
+ LayerAnimationElement::ToAnimatableProperty(target_property);
RunningAnimation* running = GetRunningAnimation(property);
if (!running)
return;
DCHECK(running->is_sequence_alive());
- if (running->sequence()->animation_group_id() != event.group_id)
+ if (running->sequence()->animation_group_id() != group_id)
return;
- running->sequence()->OnThreadedAnimationStarted(event);
+ running->sequence()->OnThreadedAnimationStarted(monotonic_time,
+ target_property, group_id);
if (!running->sequence()->waiting_for_group_start())
return;
- base::TimeTicks start_time = event.monotonic_time;
+ base::TimeTicks start_time = monotonic_time;
running->sequence()->set_waiting_for_group_start(false);
@@ -432,7 +432,7 @@ void LayerAnimator::OnThreadedAnimationStarted(
iter != running_animations_.end(); ++iter) {
// Ensure that each sequence is only Started once, regardless of the
// number of sequences in the group that have threaded first elements.
- if (((*iter).sequence()->animation_group_id() == event.group_id) &&
+ if (((*iter).sequence()->animation_group_id() == group_id) &&
!(*iter).sequence()->IsFirstElementThreaded() &&
(*iter).sequence()->waiting_for_group_start()) {
(*iter).sequence()->set_start_time(start_time);
@@ -952,8 +952,11 @@ LayerAnimatorCollection* LayerAnimator::GetLayerAnimatorCollection() {
return delegate_ ? delegate_->GetLayerAnimatorCollection() : NULL;
}
-void LayerAnimator::OnAnimationStarted(const cc::AnimationEvent& event) {
- OnThreadedAnimationStarted(event);
+void LayerAnimator::NotifyAnimationStarted(
+ base::TimeTicks monotonic_time,
+ cc::TargetProperty::Type target_property,
+ int group) {
+ OnThreadedAnimationStarted(monotonic_time, target_property, group);
}
LayerAnimator::RunningAnimation::RunningAnimation(
« no previous file with comments | « ui/compositor/layer_animator.h ('k') | ui/compositor/layer_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698