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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2841263002: [VSync Queue] Flush input in CommitComplete() (Closed)
Patch Set: sunnyps's review: Add comment Created 3 years, 8 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') | no next file » | 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 6965594181cb0a4dd868f89b7894ae6e36d2fdfa..88a5f1e712d4d90952cfca6327dbdf10a04325d5 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,11 @@ void LayerTreeHostImpl::BeginCommit() {
void LayerTreeHostImpl::CommitComplete() {
TRACE_EVENT0("cc", "LayerTreeHostImpl::CommitComplete");
+ // In high latency mode commit cannot finish within the same frame. We need to
+ // flush input here to make sure they got picked up by |PrepareTiles()|.
+ if (input_handler_client_ && impl_thread_phase_ == ImplThreadPhase::IDLE)
+ input_handler_client_->DeliverInputForBeginFrame();
+
UpdateSyncTreeAfterCommitOrImplSideInvalidation();
micro_benchmark_controller_.DidCompleteCommit();
}
@@ -1910,9 +1916,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();
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698