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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1111743002: cc: Adding DidFinishImplFrame to LTHI. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing surfaces_scheduler. Created 5 years, 7 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 1c602b9b944708a3d63a9f83262bc2814f1f16b0..eea6236ab6280627eba8b0e6a3e251c90781b26d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -1671,7 +1671,12 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) {
void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
// Sample the frame time now. This time will be used for updating animations
// when we draw.
- UpdateCurrentBeginFrameArgs(args);
+ DCHECK(!current_begin_frame_args_.IsValid());
+ current_begin_frame_args_ = args;
+ // TODO(mithro): Stop overriding the frame time once the usage of frame
+ // timing is unified.
+ current_begin_frame_args_.frame_time = gfx::FrameTime::Now();
+
// Cache the begin impl frame interval
begin_impl_frame_interval_ = args.interval;
@@ -1686,6 +1691,11 @@ void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
it->OnBeginFrame(args);
}
+void LayerTreeHostImpl::DidFinishImplFrame() {
+ DCHECK(current_begin_frame_args_.IsValid());
+ current_begin_frame_args_ = BeginFrameArgs();
+}
+
void LayerTreeHostImpl::UpdateViewportContainerSizes() {
LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer();
LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer();
@@ -3133,19 +3143,6 @@ TreePriority LayerTreeHostImpl::GetTreePriority() const {
return global_tile_state_.tree_priority;
}
-void LayerTreeHostImpl::UpdateCurrentBeginFrameArgs(
- const BeginFrameArgs& args) {
- DCHECK(!current_begin_frame_args_.IsValid());
- current_begin_frame_args_ = args;
- // TODO(skyostil): Stop overriding the frame time once the usage of frame
- // timing is unified.
- current_begin_frame_args_.frame_time = gfx::FrameTime::Now();
-}
-
-void LayerTreeHostImpl::ResetCurrentBeginFrameArgsForNextFrame() {
- current_begin_frame_args_ = BeginFrameArgs();
-}
-
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
« 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