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 e155be69517bd86761125deddecbded319767b07..dd2b3905c32fd1900219a42b978b8ff7ea1f6db2 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -161,7 +161,7 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient { |
} |
layer_tree_host_impl_->Animate( |
- layer_tree_host_impl_->CurrentFrameTimeTicks()); |
+ layer_tree_host_impl_->CurrentBeginFrameArgs().frame_time); |
mithro-old
2014/08/11 07:33:33
An example of the Animate verse BeginFrame here?
Sami
2014/08/11 17:51:26
We chatted about this and came to the conclusion t
|
layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true); |
bool start_ready_animations = true; |
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations); |
@@ -1672,7 +1672,7 @@ void LayerTreeHostImpl::SetNeedsBeginFrame(bool enable) { |
void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { |
// Sample the frame time now. This time will be used for updating animations |
// when we draw. |
- UpdateCurrentFrameTime(); |
+ UpdateCurrentFrameTime(args); |
// Cache the begin impl frame interval |
begin_impl_frame_interval_ = args.interval; |
mithro-old
2014/08/11 07:33:33
Should we log a bug to remove this value now it's
Sami
2014/08/11 17:51:26
It doesn't look like it's completely redundant sin
|
} |
@@ -2393,9 +2393,9 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( |
new_target.SetToMax(gfx::Vector2dF()); |
new_target.SetToMin(layer_impl->MaxScrollOffset()); |
- curve->UpdateTarget( |
- animation->TrimTimeToCurrentIteration(CurrentFrameTimeTicks()), |
- new_target); |
+ curve->UpdateTarget(animation->TrimTimeToCurrentIteration( |
+ CurrentBeginFrameArgs().frame_time), |
+ new_target); |
return ScrollStarted; |
} |
@@ -3154,22 +3154,25 @@ void LayerTreeHostImpl::SetTreePriority(TreePriority priority) { |
DidModifyTilePriorities(); |
} |
-void LayerTreeHostImpl::UpdateCurrentFrameTime() { |
- DCHECK(current_frame_timeticks_.is_null()); |
- current_frame_timeticks_ = gfx::FrameTime::Now(); |
+void LayerTreeHostImpl::UpdateCurrentFrameTime(const BeginFrameArgs& args) { |
mithro-old
2014/08/11 07:33:33
UpdateCurrentFrameTime previously didn't take argu
Sami
2014/08/11 17:51:26
Now that this is called UpdateCurrentBeginFrameArg
|
+ DCHECK(!current_begin_frame_args_.IsValid()); |
+ current_begin_frame_args_ = args; |
+ current_begin_frame_args_.frame_time = gfx::FrameTime::Now(); |
mithro-old
2014/08/11 07:33:33
Can we add a comment about this now usage. It's go
Sami
2014/08/11 17:51:26
Can you suggest something to write, because I don'
|
} |
void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() { |
- current_frame_timeticks_ = base::TimeTicks(); |
+ current_begin_frame_args_ = BeginFrameArgs(); |
} |
-base::TimeTicks LayerTreeHostImpl::CurrentFrameTimeTicks() { |
+BeginFrameArgs LayerTreeHostImpl::CurrentBeginFrameArgs() const { |
// Try to use the current frame time to keep animations non-jittery. But if |
// we're not in a frame (because this is during an input event or a delayed |
// task), fall back to physical time. This should still be monotonic. |
- if (!current_frame_timeticks_.is_null()) |
- return current_frame_timeticks_; |
- return gfx::FrameTime::Now(); |
+ if (current_begin_frame_args_.IsValid()) |
+ return current_begin_frame_args_; |
+ return BeginFrameArgs::Create(gfx::FrameTime::Now(), |
+ base::TimeTicks(), |
+ BeginFrameArgs::DefaultInterval()); |
mithro-old
2014/08/11 07:33:33
I'm still trying to make this go away :(
|
} |
scoped_refptr<base::debug::ConvertableToTraceFormat> |