Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 7c338a4f8ec0e094768027c90fdfaa58fddb2515..4704dcab80728e09718dca54b0132524fa4000ef 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -242,19 +242,20 @@ void LayerTreeImpl::UpdateScrollbars(int scroll_layer_id, int clip_layer_id) { |
} |
bool scrollbar_needs_animation = false; |
+ bool clip_layer_size_did_change = false; |
bool scroll_layer_size_did_change = false; |
bool y_offset_did_change = false; |
for (ScrollbarLayerImplBase* scrollbar : ScrollbarsFor(scroll_layer_id)) { |
if (scrollbar->orientation() == HORIZONTAL) { |
scrollbar_needs_animation |= scrollbar->SetCurrentPos(current_offset.x()); |
- scrollbar_needs_animation |= |
+ scrollbar_needs_animation |= clip_layer_size_did_change |= |
scrollbar->SetClipLayerLength(clip_size.width()); |
scrollbar_needs_animation |= scroll_layer_size_did_change |= |
scrollbar->SetScrollLayerLength(scroll_size.width()); |
} else { |
scrollbar_needs_animation |= y_offset_did_change |= |
scrollbar->SetCurrentPos(current_offset.y()); |
- scrollbar_needs_animation |= |
+ scrollbar_needs_animation |= clip_layer_size_did_change |= |
scrollbar->SetClipLayerLength(clip_size.height()); |
scrollbar_needs_animation |= scroll_layer_size_did_change |= |
scrollbar->SetScrollLayerLength(scroll_size.height()); |
@@ -271,8 +272,14 @@ void LayerTreeImpl::UpdateScrollbars(int scroll_layer_id, int clip_layer_id) { |
ScrollbarAnimationController* controller = |
layer_tree_host_impl_->ScrollbarAnimationControllerForId( |
scroll_layer_id); |
- if (controller) |
- controller->DidScrollUpdate(scroll_layer_size_did_change); |
+ if (!controller) |
+ return; |
+ |
+ if (clip_layer_size_did_change || scroll_layer_size_did_change) { |
+ controller->DidResize(); |
+ } else { |
+ controller->WillUpdateScroll(); |
+ } |
} |
} |
@@ -1029,8 +1036,8 @@ bool LayerTreeImpl::UpdateDrawProperties( |
can_render_to_separate_surface, |
settings().layer_transforms_should_scale_layer_contents, |
settings().verify_clip_tree_calculations, |
- verify_visible_rect_calculations, |
- &render_surface_layer_list_, &property_trees_); |
+ verify_visible_rect_calculations, &render_surface_layer_list_, |
+ &property_trees_); |
LayerTreeHostCommon::CalculateDrawProperties(&inputs); |
if (const char* client_name = GetClientNameForMetrics()) { |
UMA_HISTOGRAM_COUNTS( |