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

Unified Diff: cc/trees/layer_tree_host_in_process.cc

Issue 2365793002: Fix scroll chaining for non-descendants of root scroller. (Closed)
Patch Set: Rebase + Hack for telemetry Created 4 years, 2 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
Index: cc/trees/layer_tree_host_in_process.cc
diff --git a/cc/trees/layer_tree_host_in_process.cc b/cc/trees/layer_tree_host_in_process.cc
index f980b489a44074c12908f8d2316ed967c7d96084..f420f887c1a88ad88704621d95c7c6f85e451b05 100644
--- a/cc/trees/layer_tree_host_in_process.cc
+++ b/cc/trees/layer_tree_host_in_process.cc
@@ -450,11 +450,24 @@ void LayerTreeHostInProcess::FinishCommitOnImplThread(
sync_tree->set_source_frame_number(SourceFrameNumber());
+ // TODO(bokan): The tree sync might destroy the currently scrolling layer.
+ // Normally, this would be fine and we'd just drop incoming scrolls but some
+ // telemetry tests rely on the viewport not having this behavior. Those should
+ // be fixed and this removed. crbug.com/652905.
+ bool restore_currently_scrolling_viewport =
+ host_impl->IsCurrentlyScrollingViewport();
+
if (layer_tree_->needs_full_tree_sync())
TreeSynchronizer::SynchronizeTrees(layer_tree_->root_layer(), sync_tree);
layer_tree_->PushPropertiesTo(sync_tree);
+ if (restore_currently_scrolling_viewport &&
+ !host_impl->IsCurrentlyScrollingViewport()) {
+ host_impl->active_tree()->SetCurrentlyScrollingLayer(
+ host_impl->ViewportMainScrollLayer());
+ }
+
sync_tree->PassSwapPromises(swap_promise_manager_.TakeSwapPromises());
host_impl->SetHasGpuRasterizationTrigger(has_gpu_rasterization_trigger_);

Powered by Google App Engine
This is Rietveld 408576698