Chromium Code Reviews| 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 6965594181cb0a4dd868f89b7894ae6e36d2fdfa..a78efd12baa5076f6091185ca109aecbab11a47b 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -242,7 +242,8 @@ LayerTreeHostImpl::LayerTreeHostImpl( |
| scroll_animating_latched_node_id_(ScrollTree::kInvalidNodeId), |
| has_scrolled_by_wheel_(false), |
| has_scrolled_by_touch_(false), |
| - touchpad_and_wheel_scroll_latching_enabled_(false) { |
| + touchpad_and_wheel_scroll_latching_enabled_(false), |
| + impl_thread_phase_(ImplThreadPhase::IDLE) { |
| DCHECK(mutator_host_); |
| mutator_host_->SetMutatorHostClient(this); |
| @@ -340,6 +341,9 @@ void LayerTreeHostImpl::BeginCommit() { |
| void LayerTreeHostImpl::CommitComplete() { |
| TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete"); |
| + if (input_handler_client_ && impl_thread_phase_ == ImplThreadPhase::IDLE) |
|
sunnyps
2017/05/03 18:37:13
nit: can you please add a comment explaining why w
chongz
2017/05/03 20:32:33
Done.
|
| + input_handler_client_->DeliverInputForBeginFrame(); |
| + |
| UpdateSyncTreeAfterCommitOrImplSideInvalidation(); |
| micro_benchmark_controller_.DidCompleteCommit(); |
| } |
| @@ -1910,9 +1914,12 @@ void LayerTreeHostImpl::WillBeginImplFrame(const BeginFrameArgs& args) { |
| for (auto* it : video_frame_controllers_) |
| it->OnBeginFrame(args); |
| + |
| + impl_thread_phase_ = ImplThreadPhase::INSIDE_IMPL_FRAME; |
| } |
| void LayerTreeHostImpl::DidFinishImplFrame() { |
| + impl_thread_phase_ = ImplThreadPhase::IDLE; |
| current_begin_frame_tracker_.Finish(); |
| decoded_image_tracker_.NotifyFrameFinished(); |
| } |