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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 657063004: Only call UpdateScrollOffsetDelegate once on setting delegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed crash in cc_unittests Created 6 years, 2 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
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 206ec60776699eaec2688670de3c7543318614d6..648f683f8997e5ae228d422467fb260ebc3d32bd 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -51,7 +51,6 @@ class LayerScrollOffsetDelegateProxy : public LayerImpl::ScrollOffsetDelegate {
// LayerScrollOffsetDelegate implementation.
void SetTotalScrollOffset(const gfx::ScrollOffset& new_offset) override {
last_set_scroll_offset_ = new_offset;
- layer_tree_impl_->UpdateScrollOffsetDelegate();
}
gfx::ScrollOffset GetTotalScrollOffset() override {
@@ -62,6 +61,10 @@ class LayerScrollOffsetDelegateProxy : public LayerImpl::ScrollOffsetDelegate {
return delegate_->IsExternalFlingActive();
}
+ void Update() const override {
+ layer_tree_impl_->UpdateScrollOffsetDelegate();
+ }
+
private:
LayerImpl* layer_;
LayerScrollOffsetDelegate* delegate_;
@@ -930,6 +933,9 @@ void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
outer_viewport_scroll_layer_->SetScrollOffsetDelegate(
outer_viewport_scroll_delegate_proxy_.get());
}
+
+ if (inner_viewport_scroll_layer_)
+ UpdateScrollOffsetDelegate();
}
}
@@ -945,6 +951,7 @@ void LayerTreeImpl::OnRootLayerDelegatedScrollOffsetChanged() {
void LayerTreeImpl::UpdateScrollOffsetDelegate() {
DCHECK(InnerViewportScrollLayer());
+ DCHECK(!OuterViewportScrollLayer() || outer_viewport_scroll_delegate_proxy_);
DCHECK(root_layer_scroll_offset_delegate_);
gfx::ScrollOffset offset =
« no previous file with comments | « cc/layers/layer_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698