Chromium Code Reviews| Index: cc/layers/layer_impl.cc |
| diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc |
| index 2b1193370eee237e307ce28f4074ce6a3134ce8c..8d31903b56968b63448c3d92cfbf89f2578c5de9 100644 |
| --- a/cc/layers/layer_impl.cc |
| +++ b/cc/layers/layer_impl.cc |
| @@ -400,20 +400,16 @@ void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { |
| // Pending tree never has sent scroll deltas |
| DCHECK(layer_tree_impl()->IsActiveTree()); |
| + // The pending tree shouldn't exist during aborted commits; we don't know how |
|
danakj
2014/11/04 21:11:34
Can you maybe say the pending tree shouldn't exist
aelias_OOO_until_Jul13
2014/11/04 21:19:16
Good idea. I added an early return and made the c
|
| + // to update its deltas in this case. |
| + DCHECK(!layer_tree_impl()->FindPendingTreeLayerById(id())); |
|
enne (OOO)
2014/11/04 23:31:49
Yeah, by definition there is no pending tree durin
aelias_OOO_until_Jul13
2014/11/04 23:35:00
Thanks for the clarification. I wanted to check f
|
| + |
| // Apply sent scroll deltas to scroll position / scroll delta as if the |
| // main thread had applied them and then committed those values. |
| - // |
| - // This function should not change the total scroll offset; it just shifts |
| - // some of the scroll delta to the scroll offset. Therefore, adjust these |
| - // variables directly rather than calling the scroll offset delegate to |
| - // avoid sending it multiple spurious calls. |
| - // |
| - // Because of the way scroll delta is calculated with a delegate, this will |
| - // leave the total scroll offset unchanged on this layer regardless of |
| - // whether a delegate is being used. |
| - scroll_offset_ += gfx::ScrollOffset(sent_scroll_delta_); |
| - scroll_delta_ -= sent_scroll_delta_; |
| - sent_scroll_delta_ = gfx::Vector2dF(); |
| + SetScrollOffsetAndDelta( |
| + scroll_offset_ + gfx::ScrollOffset(sent_scroll_delta_), |
| + ScrollDelta() - sent_scroll_delta_); |
| + SetSentScrollDelta(gfx::Vector2dF()); |
| } |
| void LayerImpl::ApplyScrollDeltasSinceBeginMainFrame() { |