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

Unified Diff: cc/layers/layer_impl.cc

Issue 608223002: [Android]Increase Scrollbar fade delay on Resize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 29bdfe778fdf522fc9a3a8f97d74ef4adb90b71c..bc8f8f3b049327e662d3d142d9509f2fee607278 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1275,27 +1275,28 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
current_offset.Scale(layer_tree_impl()->total_page_scale_factor());
}
- bool scrollbar_needs_animation = false;
- scrollbar_needs_animation |= scrollbar_layer->SetVerticalAdjust(
+ bool did_scrollbar_position_changed = false;
+ bool did_scrollbar_resize = false;
+ did_scrollbar_position_changed |= scrollbar_layer->SetVerticalAdjust(
scrollbar_clip_layer->bounds_delta().y());
if (scrollbar_layer->orientation() == HORIZONTAL) {
float visible_ratio = clip_rect.width() / scroll_rect.width();
- scrollbar_needs_animation |=
+ did_scrollbar_position_changed |=
scrollbar_layer->SetCurrentPos(current_offset.x());
- scrollbar_needs_animation |=
+ did_scrollbar_resize |=
scrollbar_layer->SetMaximum(scroll_rect.width() - clip_rect.width());
- scrollbar_needs_animation |=
+ did_scrollbar_resize |=
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio);
} else {
float visible_ratio = clip_rect.height() / scroll_rect.height();
- scrollbar_needs_animation |=
+ did_scrollbar_position_changed |=
scrollbar_layer->SetCurrentPos(current_offset.y());
- scrollbar_needs_animation |=
+ did_scrollbar_resize |=
scrollbar_layer->SetMaximum(scroll_rect.height() - clip_rect.height());
- scrollbar_needs_animation |=
+ did_scrollbar_resize |=
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio);
}
- if (scrollbar_needs_animation) {
+ if (did_scrollbar_position_changed || did_scrollbar_resize) {
layer_tree_impl()->set_needs_update_draw_properties();
// TODO(wjmaclean) The scrollbar animator for the pinch-zoom scrollbars
// should activate for every scroll on the main frame, not just the
@@ -1311,7 +1312,7 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
layer_tree_impl()->min_page_scale_factor()) ||
!layer_tree_impl()->settings().use_pinch_zoom_scrollbars);
if (is_animatable_scrollbar)
- scrollbar_animation_controller_->DidScrollUpdate();
+ scrollbar_animation_controller_->DidScrollUpdate(did_scrollbar_resize);
}
}
}

Powered by Google App Engine
This is Rietveld 408576698