diff --git a/cc/animation/animation_delegate.h b/cc/animation/animation_delegate.h index f1176a36a46fad..0f83bec44c63c0 100644 --- a/cc/animation/animation_delegate.h +++ b/cc/animation/animation_delegate.h @@ -12,14 +12,10 @@ namespace cc { class AnimationDelegate { public: - // TODO(ajuma): Remove wall_clock_time once the legacy implementation of - // CSS animations and transitions in Blink is removed. virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) = 0; virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) = 0; diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc index 918d8b80e20135..f255db5befe8a8 100644 --- a/cc/animation/layer_animation_controller.cc +++ b/cc/animation/layer_animation_controller.cc @@ -280,16 +280,15 @@ void LayerAnimationController::SetAnimationRegistrar( } void LayerAnimationController::NotifyAnimationStarted( - const AnimationEvent& event, - double wall_clock_time) { + const AnimationEvent& event) { base::TimeTicks monotonic_time = base::TimeTicks::FromInternalValue( event.monotonic_time * base::Time::kMicrosecondsPerSecond); if (event.is_impl_only) { FOR_EACH_OBSERVER(LayerAnimationEventObserver, event_observers_, OnAnimationStarted(event)); if (layer_animation_delegate_) - layer_animation_delegate_->NotifyAnimationStarted( - wall_clock_time, monotonic_time, event.target_property); + layer_animation_delegate_->NotifyAnimationStarted(monotonic_time, + event.target_property); return; } @@ -305,7 +304,7 @@ void LayerAnimationController::NotifyAnimationStarted( OnAnimationStarted(event)); if (layer_animation_delegate_) layer_animation_delegate_->NotifyAnimationStarted( - wall_clock_time, monotonic_time, event.target_property); + monotonic_time, event.target_property); return; } @@ -313,14 +312,13 @@ void LayerAnimationController::NotifyAnimationStarted( } void LayerAnimationController::NotifyAnimationFinished( - const AnimationEvent& event, - double wall_clock_time) { + const AnimationEvent& event) { base::TimeTicks monotonic_time = base::TimeTicks::FromInternalValue( event.monotonic_time * base::Time::kMicrosecondsPerSecond); if (event.is_impl_only) { if (layer_animation_delegate_) - layer_animation_delegate_->NotifyAnimationFinished( - wall_clock_time, monotonic_time, event.target_property); + layer_animation_delegate_->NotifyAnimationFinished(monotonic_time, + event.target_property); return; } @@ -330,7 +328,7 @@ void LayerAnimationController::NotifyAnimationFinished( active_animations_[i]->set_received_finished_event(true); if (layer_animation_delegate_) layer_animation_delegate_->NotifyAnimationFinished( - wall_clock_time, monotonic_time, event.target_property); + monotonic_time, event.target_property); return; } diff --git a/cc/animation/layer_animation_controller.h b/cc/animation/layer_animation_controller.h index bb75107f893852..9562c0a2db092e 100644 --- a/cc/animation/layer_animation_controller.h +++ b/cc/animation/layer_animation_controller.h @@ -83,10 +83,8 @@ class CC_EXPORT LayerAnimationController void SetAnimationRegistrar(AnimationRegistrar* registrar); AnimationRegistrar* animation_registrar() { return registrar_; } - void NotifyAnimationStarted(const AnimationEvent& event, - double wall_clock_time); - void NotifyAnimationFinished(const AnimationEvent& event, - double wall_clock_time); + void NotifyAnimationStarted(const AnimationEvent& event); + void NotifyAnimationFinished(const AnimationEvent& event); void NotifyAnimationAborted(const AnimationEvent& event); void NotifyAnimationPropertyUpdate(const AnimationEvent& event); diff --git a/cc/animation/layer_animation_controller_unittest.cc b/cc/animation/layer_animation_controller_unittest.cc index fd545724cbca2d..5b79ccb6949f04 100644 --- a/cc/animation/layer_animation_controller_unittest.cc +++ b/cc/animation/layer_animation_controller_unittest.cc @@ -84,7 +84,7 @@ TEST(LayerAnimationControllerTest, DoNotClobberStartTimes) { // Synchronize the start times. EXPECT_EQ(1u, events.size()); - controller->NotifyAnimationStarted(events[0], 0.0); + controller->NotifyAnimationStarted(events[0]); EXPECT_EQ(controller->GetAnimation(group_id, Animation::Opacity)->start_time(), controller_impl->GetAnimation(group_id, @@ -136,7 +136,7 @@ TEST(LayerAnimationControllerTest, Activation) { controller_impl->Animate(kInitialTickTime); controller_impl->UpdateState(true, events.get()); EXPECT_EQ(1u, events->size()); - controller->NotifyAnimationStarted((*events)[0], 0.0); + controller->NotifyAnimationStarted((*events)[0]); EXPECT_EQ(1u, registrar->active_animation_controllers().size()); EXPECT_EQ(1u, registrar_impl->active_animation_controllers().size()); @@ -161,7 +161,7 @@ TEST(LayerAnimationControllerTest, Activation) { EXPECT_EQ(0u, registrar_impl->active_animation_controllers().size()); EXPECT_EQ(1u, events->size()); - controller->NotifyAnimationFinished((*events)[0], 0.0); + controller->NotifyAnimationFinished((*events)[0]); controller->Animate(kInitialTickTime + 1.5); controller->UpdateState(true, NULL); @@ -258,7 +258,7 @@ TEST(LayerAnimationControllerTest, DoNotSyncFinishedAnimation) { group_id, Animation::Opacity, kInitialTickTime); - controller->NotifyAnimationStarted(animation_started_event, 0.0); + controller->NotifyAnimationStarted(animation_started_event); // Force animation to complete on impl thread. controller_impl->RemoveAnimation(animation_id); @@ -297,7 +297,7 @@ TEST(LayerAnimationControllerTest, AnimationsAreDeleted) { // There should be a Started event for the animation. EXPECT_EQ(1u, events->size()); EXPECT_EQ(AnimationEvent::Started, (*events)[0].type); - controller->NotifyAnimationStarted((*events)[0], 0.0); + controller->NotifyAnimationStarted((*events)[0]); controller->Animate(kInitialTickTime + 1.0); controller->UpdateState(true, NULL); @@ -319,7 +319,7 @@ TEST(LayerAnimationControllerTest, AnimationsAreDeleted) { EXPECT_TRUE(controller->GetAnimation(Animation::Opacity)); EXPECT_TRUE(controller_impl->GetAnimation(Animation::Opacity)); - controller->NotifyAnimationFinished((*events)[0], 0.0); + controller->NotifyAnimationFinished((*events)[0]); controller->Animate(kInitialTickTime + 3.0); controller->UpdateState(true, NULL); @@ -611,7 +611,7 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransition) { const AnimationEvent* event = GetMostRecentPropertyUpdateEvent(events.get()); EXPECT_FALSE(event); - controller->NotifyAnimationStarted((*events)[0], 0.0); + controller->NotifyAnimationStarted((*events)[0]); controller->Animate(kInitialTickTime + duration/2.0); controller->UpdateState(true, NULL); EXPECT_TRUE(controller->HasActiveAnimation()); @@ -689,7 +689,7 @@ TEST(LayerAnimationControllerTest, ScrollOffsetTransitionNoImplProvider) { const AnimationEvent* event = GetMostRecentPropertyUpdateEvent(events.get()); EXPECT_FALSE(event); - controller->NotifyAnimationStarted((*events)[0], 0.0); + controller->NotifyAnimationStarted((*events)[0]); controller->Animate(kInitialTickTime + duration/2.0); controller->UpdateState(true, NULL); EXPECT_TRUE(controller->HasActiveAnimation()); @@ -767,14 +767,12 @@ class FakeAnimationDelegate : public AnimationDelegate { finished_(false) {} virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { started_ = true; } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { finished_ = true; @@ -826,7 +824,7 @@ TEST(LayerAnimationControllerTest, // Passing on the start event to the main thread controller should cause the // delegate to get notified. EXPECT_FALSE(delegate.started()); - controller->NotifyAnimationStarted((*events)[0], 0.0); + controller->NotifyAnimationStarted((*events)[0]); EXPECT_TRUE(delegate.started()); events.reset(new AnimationEventsVector); @@ -843,7 +841,7 @@ TEST(LayerAnimationControllerTest, // Passing on the finished event to the main thread controller should cause // the delegate to get notified. EXPECT_FALSE(delegate.finished()); - controller->NotifyAnimationFinished((*events)[0], 0.0); + controller->NotifyAnimationFinished((*events)[0]); EXPECT_TRUE(delegate.finished()); } @@ -881,12 +879,8 @@ TEST(LayerAnimationControllerTest, EXPECT_EQ(0.f, dummy.opacity()); // Send the synchronized start time. - controller->NotifyAnimationStarted(AnimationEvent(AnimationEvent::Started, - 0, - 1, - Animation::Opacity, - kInitialTickTime + 2), - 0.0); + controller->NotifyAnimationStarted(AnimationEvent( + AnimationEvent::Started, 0, 1, Animation::Opacity, kInitialTickTime + 2)); controller->Animate(kInitialTickTime + 5.0); controller->UpdateState(true, events.get()); EXPECT_EQ(1.f, dummy.opacity()); diff --git a/cc/test/layer_tree_test.h b/cc/test/layer_tree_test.h index 43cfb88e88f35e..b017d0ff6d43b0 100644 --- a/cc/test/layer_tree_test.h +++ b/cc/test/layer_tree_test.h @@ -81,12 +81,10 @@ class TestHooks : public AnimationDelegate { virtual base::TimeDelta LowFrequencyAnimationInterval() const; // Implementation of AnimationDelegate: - virtual void NotifyAnimationStarted(double wall_clock_time, - base::TimeTicks monotonic_time, + virtual void NotifyAnimationStarted(base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE {} virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE {} diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc index 2a8248e25223f9..aab0e6765a20cc 100644 --- a/cc/trees/layer_tree_host.cc +++ b/cc/trees/layer_tree_host.cc @@ -577,13 +577,11 @@ void LayerTreeHost::SetAnimationEvents(scoped_ptr events, if (iter != animation_controllers.end()) { switch ((*events)[event_index].type) { case AnimationEvent::Started: - (*iter).second->NotifyAnimationStarted((*events)[event_index], - wall_clock_time.ToDoubleT()); + (*iter).second->NotifyAnimationStarted((*events)[event_index]); break; case AnimationEvent::Finished: - (*iter).second->NotifyAnimationFinished((*events)[event_index], - wall_clock_time.ToDoubleT()); + (*iter).second->NotifyAnimationFinished((*events)[event_index]); break; case AnimationEvent::Aborted: diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index ee12e5cf596108..7a9b63f5881962 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -149,7 +149,6 @@ class LayerTreeHostAnimationTestAddAnimation } virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { received_animation_started_notification_ = true; @@ -243,7 +242,6 @@ class LayerTreeHostAnimationTestAnimationsGetDeleted } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { // Animations on the impl-side controller only get deleted during a commit, @@ -371,7 +369,6 @@ class LayerTreeHostAnimationTestNoBackgroundTickingWithoutActiveTree } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { // Replace animated commits with an empty tree. @@ -564,7 +561,6 @@ class LayerTreeHostAnimationTestSynchronizeAnimationStartTimes } virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { LayerAnimationController* controller = @@ -622,7 +618,6 @@ class LayerTreeHostAnimationTestAnimationFinishedEvents } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { LayerAnimationController* controller = @@ -958,14 +953,12 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotCanDraw } virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { started_times_++; } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { EndTest(); @@ -1010,7 +1003,6 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible } virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { EXPECT_FALSE(visible_); @@ -1018,7 +1010,6 @@ class LayerTreeHostAnimationTestRunAnimationWhenNotVisible } virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { EXPECT_FALSE(visible_); @@ -1095,7 +1086,6 @@ class LayerTreeHostAnimationTestCheckerboardDoesntStartAnimations } virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, Animation::TargetProperty target_property) OVERRIDE { if (TestEnded()) diff --git a/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc b/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc index 90756f1e550a5b..a1de2a26869f9f 100644 --- a/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc +++ b/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.cc @@ -13,7 +13,6 @@ WebToCCAnimationDelegateAdapter::WebToCCAnimationDelegateAdapter( : delegate_(delegate) {} void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, cc::Animation::TargetProperty target_property) { delegate_->notifyAnimationStarted( @@ -22,7 +21,6 @@ void WebToCCAnimationDelegateAdapter::NotifyAnimationStarted( } void WebToCCAnimationDelegateAdapter::NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, cc::Animation::TargetProperty target_property) { delegate_->notifyAnimationFinished( diff --git a/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h b/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h index 7338322e99d846..951a9a669cdecb 100644 --- a/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h +++ b/webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h @@ -20,11 +20,9 @@ class WebToCCAnimationDelegateAdapter : public cc::AnimationDelegate { private: virtual void NotifyAnimationStarted( - double wall_clock_time, base::TimeTicks monotonic_time, cc::Animation::TargetProperty target_property) OVERRIDE; virtual void NotifyAnimationFinished( - double wall_clock_time, base::TimeTicks monotonic_time, cc::Animation::TargetProperty target_property) OVERRIDE;