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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Rebase 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_in_process.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 fba5c66017f87d556044816ac33e24bb8a943493..363e940899c1d80631d68686ea3b83e7ed27c6bb 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2215,6 +2215,10 @@ LayerImpl* LayerTreeHostImpl::ViewportMainScrollLayer() {
return viewport()->MainScrollLayer();
}
+void LayerTreeHostImpl::DidChangeScrollbarVisibility() {
+ client_->SetNeedsCommitOnImplThread();
+}
+
void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
ClearUIResources();
tile_manager_.FinishTasksAndCleanUp();
@@ -3343,14 +3347,26 @@ static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
? tree_impl->InnerViewportScrollLayer()->id()
: Layer::INVALID_ID;
- return tree_impl->property_trees()->scroll_tree.CollectScrollDeltas(
+ tree_impl->property_trees()->scroll_tree.CollectScrollDeltas(
scroll_info, inner_viewport_layer_id);
}
+static void CollectScrollbarUpdates(
+ ScrollAndScaleSet* scroll_info,
+ std::unordered_map<int, std::unique_ptr<ScrollbarAnimationController>>*
+ controllers) {
+ scroll_info->scrollbars.reserve(controllers->size());
+ for (auto& pair : *controllers) {
+ scroll_info->scrollbars.push_back(LayerTreeHostCommon::ScrollbarsUpdateInfo(
+ pair.first, pair.second->ScrollbarsHidden()));
+ }
+}
+
std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
CollectScrollDeltas(scroll_info.get(), active_tree_.get());
+ CollectScrollbarUpdates(scroll_info.get(), &scrollbar_animation_controllers_);
scroll_info->page_scale_delta =
active_tree_->page_scale_factor()->PullDeltaForMainThread();
scroll_info->top_controls_delta =
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_in_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698