Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 5c95aae203cca169a7e235edef849a266de0229e..bdac870211e9072d1db7168be365bb6686ced01f 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -168,8 +168,7 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient { |
} |
layer_tree_host_impl_->Animate( |
- layer_tree_host_impl_->CurrentFrameTimeTicks(), |
- layer_tree_host_impl_->CurrentFrameTime()); |
+ layer_tree_host_impl_->CurrentFrameTimeTicks()); |
layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true); |
bool start_ready_animations = true; |
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
@@ -397,12 +396,11 @@ bool LayerTreeHostImpl::CanDraw() const { |
return true; |
} |
-void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time, |
- base::Time wall_clock_time) { |
+void LayerTreeHostImpl::Animate(base::TimeTicks monotonic_time) { |
if (input_handler_client_) |
input_handler_client_->Animate(monotonic_time); |
AnimatePageScale(monotonic_time); |
- AnimateLayers(monotonic_time, wall_clock_time); |
+ AnimateLayers(monotonic_time); |
AnimateScrollbars(monotonic_time); |
AnimateTopControls(monotonic_time); |
} |
@@ -2646,26 +2644,27 @@ void LayerTreeHostImpl::ScrollViewportBy(gfx::Vector2dF scroll_delta) { |
InnerViewportScrollLayer()->ScrollBy(unused_delta); |
} |
-void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks time) { |
+void LayerTreeHostImpl::AnimatePageScale(base::TimeTicks monotonic_time) { |
if (!page_scale_animation_) |
return; |
- double monotonic_time = (time - base::TimeTicks()).InSecondsF(); |
+ double blink_monotonic_time = |
ajuma
2014/03/11 13:29:18
This time isn't actually sent to Blink (it's sent
mithro-old
2014/03/11 13:31:20
Why does cc::PageScaleAnimation use a double?
Is
ajuma
2014/03/11 13:37:05
Yes to both: it's leftover from the move, and shou
|
+ (monotonic_time - base::TimeTicks()).InSecondsF(); |
gfx::Vector2dF scroll_total = active_tree_->TotalScrollOffset(); |
if (!page_scale_animation_->IsAnimationStarted()) |
- page_scale_animation_->StartAnimation(monotonic_time); |
+ page_scale_animation_->StartAnimation(blink_monotonic_time); |
active_tree_->SetPageScaleDelta( |
- page_scale_animation_->PageScaleFactorAtTime(monotonic_time) / |
+ page_scale_animation_->PageScaleFactorAtTime(blink_monotonic_time) / |
active_tree_->page_scale_factor()); |
gfx::Vector2dF next_scroll = |
- page_scale_animation_->ScrollOffsetAtTime(monotonic_time); |
+ page_scale_animation_->ScrollOffsetAtTime(blink_monotonic_time); |
ScrollViewportBy(next_scroll - scroll_total); |
SetNeedsRedraw(); |
- if (page_scale_animation_->IsAnimationCompleteAtTime(monotonic_time)) { |
+ if (page_scale_animation_->IsAnimationCompleteAtTime(blink_monotonic_time)) { |
page_scale_animation_.reset(); |
client_->SetNeedsCommitOnImplThread(); |
client_->RenewTreePriority(); |
@@ -2688,8 +2687,7 @@ void LayerTreeHostImpl::AnimateTopControls(base::TimeTicks time) { |
} |
} |
-void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, |
- base::Time wall_clock_time) { |
+void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time) { |
if (!settings_.accelerated_animation_enabled || |
animation_registrar_->active_animation_controllers().empty() || |
!active_tree_->root_layer()) |
@@ -2697,14 +2695,14 @@ void LayerTreeHostImpl::AnimateLayers(base::TimeTicks monotonic_time, |
TRACE_EVENT0("cc", "LayerTreeHostImpl::AnimateLayers"); |
- double monotonic_seconds = (monotonic_time - base::TimeTicks()).InSecondsF(); |
- |
+ double blink_monotonic_time = |
ajuma
2014/03/11 13:29:18
Same naming comment as before. While this time is
|
+ (monotonic_time - base::TimeTicks()).InSecondsF(); |
AnimationRegistrar::AnimationControllerMap copy = |
animation_registrar_->active_animation_controllers(); |
for (AnimationRegistrar::AnimationControllerMap::iterator iter = copy.begin(); |
iter != copy.end(); |
++iter) |
- (*iter).second->Animate(monotonic_seconds); |
+ (*iter).second->Animate(blink_monotonic_time); |
SetNeedsRedraw(); |
} |
@@ -2861,28 +2859,19 @@ void LayerTreeHostImpl::SetTreePriority(TreePriority priority) { |
void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() { |
current_frame_timeticks_ = base::TimeTicks(); |
- current_frame_time_ = base::Time(); |
} |
-void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks, |
- base::Time* now) const { |
+void LayerTreeHostImpl::UpdateCurrentFrameTime(base::TimeTicks* ticks) const { |
if (ticks->is_null()) { |
- DCHECK(now->is_null()); |
*ticks = CurrentPhysicalTimeTicks(); |
- *now = base::Time::Now(); |
} |
} |
base::TimeTicks LayerTreeHostImpl::CurrentFrameTimeTicks() { |
- UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
+ UpdateCurrentFrameTime(¤t_frame_timeticks_); |
return current_frame_timeticks_; |
} |
-base::Time LayerTreeHostImpl::CurrentFrameTime() { |
- UpdateCurrentFrameTime(¤t_frame_timeticks_, ¤t_frame_time_); |
- return current_frame_time_; |
-} |
- |
base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const { |
return gfx::FrameTime::Now(); |
} |