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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 429743003: Rename Animate as Begin(Main)Frame (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix. Created 6 years, 4 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 | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2d7a9323edf74e7bceb7eab96100f2d8996b12f6..771d0d4db34ee053bf2a508082ef41e41ed085ab 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);
layer_tree_host_impl_->UpdateBackgroundAnimateTicking(true);
bool start_ready_animations = true;
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
@@ -171,7 +171,7 @@ class LayerTreeHostImplTimeSourceAdapter : public TimeSourceClient {
layer_tree_host_impl_->ManageTiles();
}
- layer_tree_host_impl_->ResetCurrentFrameTimeForNextFrame();
+ layer_tree_host_impl_->ResetCurrentBeginFrameArgsForNextFrame();
}
void SetActive(bool active) {
@@ -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();
+ UpdateCurrentBeginFrameArgs(args);
// Cache the begin impl frame interval
begin_impl_frame_interval_ = args.interval;
}
@@ -2391,9 +2391,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;
}
@@ -3152,22 +3152,26 @@ void LayerTreeHostImpl::SetTreePriority(TreePriority priority) {
DidModifyTilePriorities();
}
-void LayerTreeHostImpl::UpdateCurrentFrameTime() {
- DCHECK(current_frame_timeticks_.is_null());
- current_frame_timeticks_ = gfx::FrameTime::Now();
+void LayerTreeHostImpl::UpdateCurrentBeginFrameArgs(
+ const BeginFrameArgs& args) {
+ DCHECK(!current_begin_frame_args_.IsValid());
+ current_begin_frame_args_ = args;
+ current_begin_frame_args_.frame_time = gfx::FrameTime::Now();
brianderson 2014/08/16 00:11:51 I'd say just add a TODO, so it's clear that we int
Sami 2014/08/18 10:48:16 Good idea, done.
}
-void LayerTreeHostImpl::ResetCurrentFrameTimeForNextFrame() {
- current_frame_timeticks_ = base::TimeTicks();
+void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() {
+ 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());
}
scoped_refptr<base::debug::ConvertableToTraceFormat>
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698