Index: cc/animation/layer_animation_controller.cc |
diff --git a/cc/animation/layer_animation_controller.cc b/cc/animation/layer_animation_controller.cc |
index 464801ce92fb02a3803c27cfe2b837f4d066c1e5..05845fe4e4b8681ccce01230efe5c7a4b9205286 100644 |
--- a/cc/animation/layer_animation_controller.cc |
+++ b/cc/animation/layer_animation_controller.cc |
@@ -24,9 +24,10 @@ LayerAnimationController::LayerAnimationController(int id) |
: registrar_(0), |
id_(id), |
is_active_(false), |
- last_tick_time_(0), |
+ last_tick_time_(base::TimeTicks()), |
value_provider_(NULL), |
- layer_animation_delegate_(NULL) {} |
+ layer_animation_delegate_(NULL) { |
+} |
LayerAnimationController::~LayerAnimationController() { |
if (registrar_) |
@@ -39,7 +40,7 @@ scoped_refptr<LayerAnimationController> LayerAnimationController::Create( |
} |
void LayerAnimationController::PauseAnimation(int animation_id, |
- double time_offset) { |
+ base::TimeDelta time_offset) { |
for (size_t i = 0; i < active_animations_.size(); ++i) { |
if (active_animations_[i]->id() == animation_id) { |
active_animations_[i]->SetRunState( |
@@ -123,8 +124,8 @@ void LayerAnimationController::PushAnimationUpdatesTo( |
UpdateActivation(NormalActivation); |
} |
-void LayerAnimationController::Animate(double monotonic_time) { |
- DCHECK(monotonic_time); |
+void LayerAnimationController::Animate(base::TimeTicks monotonic_time) { |
+ DCHECK(monotonic_time != base::TimeTicks()); |
if (!HasValueObserver()) |
return; |
@@ -134,7 +135,7 @@ void LayerAnimationController::Animate(double monotonic_time) { |
} |
void LayerAnimationController::AccumulatePropertyUpdates( |
- double monotonic_time, |
+ base::TimeTicks monotonic_time, |
AnimationEventsVector* events) { |
if (!events) |
return; |
@@ -281,15 +282,12 @@ void LayerAnimationController::SetAnimationRegistrar( |
void LayerAnimationController::NotifyAnimationStarted( |
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(monotonic_time, |
+ layer_animation_delegate_->NotifyAnimationStarted(event.monotonic_time, |
event.target_property); |
- |
return; |
} |
@@ -305,7 +303,7 @@ void LayerAnimationController::NotifyAnimationStarted( |
OnAnimationStarted(event)); |
if (layer_animation_delegate_) |
layer_animation_delegate_->NotifyAnimationStarted( |
- monotonic_time, event.target_property); |
+ event.monotonic_time, event.target_property); |
return; |
} |
@@ -314,11 +312,9 @@ void LayerAnimationController::NotifyAnimationStarted( |
void LayerAnimationController::NotifyAnimationFinished( |
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(monotonic_time, |
+ layer_animation_delegate_->NotifyAnimationFinished(event.monotonic_time, |
event.target_property); |
return; |
} |
@@ -329,7 +325,7 @@ void LayerAnimationController::NotifyAnimationFinished( |
active_animations_[i]->set_received_finished_event(true); |
if (layer_animation_delegate_) |
layer_animation_delegate_->NotifyAnimationFinished( |
- monotonic_time, event.target_property); |
+ event.monotonic_time, event.target_property); |
return; |
} |
@@ -575,7 +571,7 @@ void LayerAnimationController::PushPropertiesToImplThread( |
} |
} |
-void LayerAnimationController::StartAnimations(double monotonic_time) { |
+void LayerAnimationController::StartAnimations(base::TimeTicks monotonic_time) { |
// First collect running properties. |
TargetProperties blocked_properties; |
for (size_t i = 0; i < active_animations_.size(); ++i) { |
@@ -626,7 +622,7 @@ void LayerAnimationController::StartAnimations(double monotonic_time) { |
} |
void LayerAnimationController::PromoteStartedAnimations( |
- double monotonic_time, |
+ base::TimeTicks monotonic_time, |
AnimationEventsVector* events) { |
for (size_t i = 0; i < active_animations_.size(); ++i) { |
if (active_animations_[i]->run_state() == Animation::Starting) { |
@@ -648,7 +644,8 @@ void LayerAnimationController::PromoteStartedAnimations( |
} |
} |
-void LayerAnimationController::MarkFinishedAnimations(double monotonic_time) { |
+void LayerAnimationController::MarkFinishedAnimations( |
+ base::TimeTicks monotonic_time) { |
for (size_t i = 0; i < active_animations_.size(); ++i) { |
if (active_animations_[i]->IsFinishedAt(monotonic_time) && |
active_animations_[i]->run_state() != Animation::Aborted && |
@@ -658,7 +655,8 @@ void LayerAnimationController::MarkFinishedAnimations(double monotonic_time) { |
} |
void LayerAnimationController::MarkAnimationsForDeletion( |
- double monotonic_time, AnimationEventsVector* events) { |
+ base::TimeTicks monotonic_time, |
+ AnimationEventsVector* events) { |
bool marked_animations_for_deletions = false; |
// Non-aborted animations are marked for deletion after a corresponding |
@@ -748,7 +746,7 @@ void LayerAnimationController::PurgeAnimationsMarkedForDeletion() { |
animations.end()); |
} |
-void LayerAnimationController::TickAnimations(double monotonic_time) { |
+void LayerAnimationController::TickAnimations(base::TimeTicks monotonic_time) { |
for (size_t i = 0; i < active_animations_.size(); ++i) { |
if (active_animations_[i]->run_state() == Animation::Starting || |
active_animations_[i]->run_state() == Animation::Running || |