Commit 7acc4b3e authored by sataya.m's avatar sataya.m Committed by Commit bot

[Android] Avoid setting update_draw_properties.

While setting up the scrollbar layer if the properties of the scrollbar
layer didn't change, then avoid setting update_draw_properties.
Scrollbar needs animation if any of the scrollbar properties changed.
In the same way set update_draw_properties if scrollbar properties
are changed.

Review URL: https://codereview.chromium.org/595913002

Cr-Commit-Position: refs/heads/master@{#296193}
parent 9d13b52b
......@@ -1295,23 +1295,24 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
scrollbar_needs_animation |=
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio);
}
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 scrolls that move
// the pinch virtual viewport (i.e. trigger from either inner or outer
// viewport).
if (scrollbar_animation_controller_ && scrollbar_needs_animation) {
// When both non-overlay and overlay scrollbars are both present, don't
// animate the overlay scrollbars when page scale factor is at the min.
// Non-overlay scrollbars also shouldn't trigger animations.
bool is_animatable_scrollbar =
scrollbar_layer->is_overlay_scrollbar() &&
((layer_tree_impl()->total_page_scale_factor() >
layer_tree_impl()->min_page_scale_factor()) ||
!layer_tree_impl()->settings().use_pinch_zoom_scrollbars);
if (is_animatable_scrollbar)
scrollbar_animation_controller_->DidScrollUpdate();
if (scrollbar_needs_animation) {
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
// scrolls that move the pinch virtual viewport (i.e. trigger from
// either inner or outer viewport).
if (scrollbar_animation_controller_) {
// When both non-overlay and overlay scrollbars are both present, don't
// animate the overlay scrollbars when page scale factor is at the min.
// Non-overlay scrollbars also shouldn't trigger animations.
bool is_animatable_scrollbar =
scrollbar_layer->is_overlay_scrollbar() &&
((layer_tree_impl()->total_page_scale_factor() >
layer_tree_impl()->min_page_scale_factor()) ||
!layer_tree_impl()->settings().use_pinch_zoom_scrollbars);
if (is_animatable_scrollbar)
scrollbar_animation_controller_->DidScrollUpdate();
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment