Index: cc/trees/thread_proxy.cc |
diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc |
index a1ce1b557c987fa121498a7acafb657db9b04655..035376777f4f06860b35a1b6b809215334f42fe1 100644 |
--- a/cc/trees/thread_proxy.cc |
+++ b/cc/trees/thread_proxy.cc |
@@ -92,7 +92,7 @@ ThreadProxy::ThreadProxy( |
in_composite_and_readback_(false), |
manage_tiles_pending_(false), |
commit_waits_for_activation_(false), |
- inside_commit_(false), |
+ main_thread_inside_commit_(false), |
begin_main_frame_sent_completion_event_on_impl_thread_(NULL), |
readback_request_on_impl_thread_(NULL), |
commit_completion_event_on_impl_thread_(NULL), |
@@ -520,7 +520,7 @@ void ThreadProxy::SetNeedsRedraw(const gfx::Rect& damage_rect) { |
void ThreadProxy::SetNextCommitWaitsForActivation() { |
DCHECK(IsMainThread()); |
- DCHECK(!inside_commit_); |
+ DCHECK(!main_thread_inside_commit_); |
commit_waits_for_activation_ = true; |
} |
@@ -1018,18 +1018,11 @@ void ThreadProxy::ScheduledActionCommit() { |
current_resource_update_controller_on_impl_thread_->Finalize(); |
current_resource_update_controller_on_impl_thread_.reset(); |
- inside_commit_ = true; |
+ main_thread_inside_commit_ = true; |
layer_tree_host_impl_->BeginCommit(); |
layer_tree_host()->BeginCommitOnImplThread(layer_tree_host_impl_.get()); |
layer_tree_host()->FinishCommitOnImplThread(layer_tree_host_impl_.get()); |
- layer_tree_host_impl_->CommitComplete(); |
- inside_commit_ = false; |
- |
- SetInputThrottledUntilCommitOnImplThread(false); |
- |
- UpdateBackgroundAnimateTicking(); |
- |
- next_frame_is_newly_committed_frame_on_impl_thread_ = true; |
+ main_thread_inside_commit_ = false; |
if (layer_tree_host()->settings().impl_side_painting && |
commit_waits_for_activation_) { |
@@ -1045,6 +1038,15 @@ void ThreadProxy::ScheduledActionCommit() { |
commit_completion_event_on_impl_thread_ = NULL; |
} |
+ // Delay this step until afer the main thread has been released as it's |
+ // often a good bit of work to update the tree and prepare the new frame. |
+ layer_tree_host_impl_->CommitComplete(); |
+ |
+ SetInputThrottledUntilCommitOnImplThread(false); |
+ |
+ UpdateBackgroundAnimateTicking(); |
+ |
+ next_frame_is_newly_committed_frame_on_impl_thread_ = true; |
commit_waits_for_activation_ = false; |
commit_complete_time_ = base::TimeTicks::HighResNow(); |