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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: 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_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 5b90fd12c5a679f7c2823aa1327898fe84ed435e..0fa98658b739108c3a736a1e65eb55a298217c2f 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -2220,6 +2220,11 @@ LayerImpl* LayerTreeHostImpl::ViewportMainScrollLayer() {
return viewport()->MainScrollLayer();
}
+void LayerTreeHostImpl::SetScrollbarsHidden(int layer_id, bool hidden) {
+ scrollbars_hidden_map_[layer_id] = hidden;
+ client_->SetNeedsCommitOnImplThread();
aelias_OOO_until_Jul13 2016/10/26 19:01:03 Please check if any of the map entries changed and
bokan 2016/10/27 20:56:46 The map is cleared on each commit so that it conta
aelias_OOO_until_Jul13 2016/10/27 21:22:09 OK. Though with that bit added to LayerImpl, the
+}
+
void LayerTreeHostImpl::CleanUpTileManagerAndUIResources() {
ClearUIResources();
tile_manager_.FinishTasksAndCleanUp();
@@ -3346,14 +3351,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, bool>* scrollbars_hidden_map) {
+ scroll_info->scrollbars.reserve(scrollbars_hidden_map->size());
+ for (auto& pair : *scrollbars_hidden_map) {
+ scroll_info->scrollbars.push_back(
+ LayerTreeHostCommon::ScrollbarsUpdateInfo(pair.first, pair.second));
+ }
+ scrollbars_hidden_map->clear();
+}
+
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(), &scrollbars_hidden_map_);
scroll_info->page_scale_delta =
active_tree_->page_scale_factor()->PullDeltaForMainThread();
scroll_info->top_controls_delta =

Powered by Google App Engine
This is Rietveld 408576698