Index: cc/layers/layer_impl.cc |
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc |
index a1a61618720e9b678b4aa577dee5866da683f52d..4b78470bef678bbb263fa94f63e6675173efdf8b 100644 |
--- a/cc/layers/layer_impl.cc |
+++ b/cc/layers/layer_impl.cc |
@@ -1322,12 +1322,17 @@ void LayerImpl::SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, |
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio); |
} else { |
float visible_ratio = clip_rect.height() / scroll_rect.height(); |
- scrollbar_needs_animation |= |
+ bool y_offset_did_change = |
scrollbar_layer->SetCurrentPos(current_offset.y()); |
+ scrollbar_needs_animation |= y_offset_did_change; |
scrollbar_needs_animation |= |
scrollbar_layer->SetMaximum(scroll_rect.height() - clip_rect.height()); |
scrollbar_needs_animation |= |
scrollbar_layer->SetVisibleToTotalLengthRatio(visible_ratio); |
+ // Record the current_offset.y() value so we can make sure |
+ // BasicMouseWheelSmoothScrollGesture has proper scroll curves. |
enne (OOO)
2015/03/25 17:21:33
What is BasicMouseWheelSmoothScrollGesture? I can'
wjmaclean
2015/03/25 20:30:32
Revised the comment to reflect the rationale given
|
+ if (y_offset_did_change && layer_tree_impl()->IsActiveTree()) |
wjmaclean
2015/03/25 20:30:32
Will limit this to the InnerViewportScrollLayer()
|
+ TRACE_EVENT1("cc", "scroll_offset_y", this->id(), current_offset.y()); |
} |
if (scrollbar_needs_animation) { |
layer_tree_impl()->set_needs_update_draw_properties(); |