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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2918753002: Prevent create ScrollbarAnimationController for Mac Overlay Scrollbar (Closed)
Patch Set: Prevent create ScrollbarAnimationController for Mac Overlay Scrollbar Created 3 years, 7 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
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('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_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 999efbfdbcfdf8762def9c2687b60f1d481fe800..290aaa29913935087e674cbd1d4ec6734c05530f 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -510,18 +510,18 @@ void LayerTreeImpl::PushPropertiesTo(LayerTreeImpl* target_tree) {
}
void LayerTreeImpl::HandleScrollbarShowRequestsFromMain() {
- LayerTreeHostCommon::CallFunctionForEveryLayer(this, [this](
- LayerImpl* layer) {
- if (!layer->needs_show_scrollbars())
- return;
- ScrollbarAnimationController* controller =
- layer_tree_host_impl_->ScrollbarAnimationControllerForElementId(
- layer->element_id());
- if (controller) {
- controller->DidRequestShowFromMainThread();
- layer->set_needs_show_scrollbars(false);
- }
- });
+ LayerTreeHostCommon::CallFunctionForEveryLayer(
+ this, [this](LayerImpl* layer) {
aelias_OOO_until_Jul13 2017/06/02 22:02:23 Please omit this unrelated whitespace change.
+ if (!layer->needs_show_scrollbars())
+ return;
+ ScrollbarAnimationController* controller =
+ layer_tree_host_impl_->ScrollbarAnimationControllerForElementId(
+ layer->element_id());
+ if (controller) {
+ controller->DidRequestShowFromMainThread();
+ layer->set_needs_show_scrollbars(false);
+ }
+ });
}
void LayerTreeImpl::MoveChangeTrackingToLayers() {
@@ -1705,7 +1705,17 @@ void LayerTreeImpl::RegisterScrollbar(ScrollbarLayerImplBase* scrollbar_layer) {
scrollbar_ids.vertical = scrollbar_layer->id();
}
- if (IsActiveTree() && scrollbar_layer->is_overlay_scrollbar()) {
+// Because we assigned settings().scrollbar_animator = Android for default, Here
+// we check IsSolidColorScrollbarLayerImpl(mobile emulator) to prevent creating
+// ScrollbarAnimationController for Mac Overlay Scrollbar.
+#if defined(OS_MACOSX)
aelias_OOO_until_Jul13 2017/06/02 22:02:23 Please find a way to avoid OS_MACOSX. How about e
+ if (IsActiveTree() && scrollbar_layer->is_overlay_scrollbar() &&
+ settings().scrollbar_animator != LayerTreeSettings::NO_ANIMATOR &&
+ scrollbar_layer->IsSolidColorScrollbarLayerImpl()) {
+#else
+ if (IsActiveTree() && scrollbar_layer->is_overlay_scrollbar() &&
+ settings().scrollbar_animator != LayerTreeSettings::NO_ANIMATOR) {
+#endif
layer_tree_host_impl_->RegisterScrollbarAnimationController(
scroll_element_id, scrollbar_layer->Opacity());
}
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698