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

Unified Diff: cc/layers/layer_impl.cc

Issue 23533051: [android_webview] Use a fraction to calculate scroll offset. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get rid of NaNs Created 7 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 b0c5399d32e3a3fd06c1963eb585e671e52a6ca4..0fdb563fa28d63d820423a4a615abeadd250856d 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -519,13 +519,13 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->SetSublayerTransform(sublayer_transform_);
layer->SetTransform(transform_);
+ layer->SetMaxScrollOffset(max_scroll_offset_);
aelias_OOO_until_Jul13 2013/09/24 22:03:19 nit: moving this line for no reason?
mkosiba (inactive) 2013/09/25 14:23:49 Done.
+
layer->SetScrollable(scrollable_);
layer->SetScrollOffsetAndDelta(
scroll_offset_, layer->ScrollDelta() - layer->sent_scroll_delta());
layer->SetSentScrollDelta(gfx::Vector2d());
- layer->SetMaxScrollOffset(max_scroll_offset_);
-
LayerImpl* scroll_parent = NULL;
if (scroll_parent_)
scroll_parent = layer->layer_tree_impl()->LayerById(scroll_parent_->id());
@@ -1001,8 +1001,10 @@ void LayerImpl::SetScrollOffsetDelegate(
}
gfx::Vector2dF total_offset = TotalScrollOffset();
scroll_offset_delegate_ = scroll_offset_delegate;
- if (scroll_offset_delegate_)
+ if (scroll_offset_delegate_) {
+ scroll_offset_delegate_->SetMaxScrollOffset(max_scroll_offset_);
scroll_offset_delegate_->SetTotalScrollOffset(total_offset);
+ }
}
void LayerImpl::SetScrollOffset(gfx::Vector2d scroll_offset) {
@@ -1088,6 +1090,9 @@ void LayerImpl::SetMaxScrollOffset(gfx::Vector2d max_scroll_offset) {
return;
max_scroll_offset_ = max_scroll_offset;
+ if (scroll_offset_delegate_)
+ scroll_offset_delegate_->SetMaxScrollOffset(max_scroll_offset_);
+
layer_tree_impl()->set_needs_update_draw_properties();
UpdateScrollbarPositions();
}

Powered by Google App Engine
This is Rietveld 408576698