| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 ScrollDelta() + scroll - new_delta; | 383 ScrollDelta() + scroll - new_delta; |
| 384 SetScrollDelta(new_delta); | 384 SetScrollDelta(new_delta); |
| 385 | 385 |
| 386 return unscrolled; | 386 return unscrolled; |
| 387 } | 387 } |
| 388 | 388 |
| 389 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { | 389 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { |
| 390 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); | 390 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); |
| 391 } | 391 } |
| 392 | 392 |
| 393 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const { |
| 394 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_ |
| 395 : user_scrollable_vertical_; |
| 396 } |
| 397 |
| 393 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { | 398 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { |
| 394 // Pending tree never has sent scroll deltas | 399 // Pending tree never has sent scroll deltas |
| 395 DCHECK(layer_tree_impl()->IsActiveTree()); | 400 DCHECK(layer_tree_impl()->IsActiveTree()); |
| 396 | 401 |
| 397 // Apply sent scroll deltas to scroll position / scroll delta as if the | 402 // Apply sent scroll deltas to scroll position / scroll delta as if the |
| 398 // main thread had applied them and then committed those values. | 403 // main thread had applied them and then committed those values. |
| 399 // | 404 // |
| 400 // This function should not change the total scroll offset; it just shifts | 405 // This function should not change the total scroll offset; it just shifts |
| 401 // some of the scroll delta to the scroll offset. Therefore, adjust these | 406 // some of the scroll delta to the scroll offset. Therefore, adjust these |
| 402 // variables directly rather than calling the scroll offset delegate to | 407 // variables directly rather than calling the scroll offset delegate to |
| (...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1573 } | 1578 } |
| 1574 | 1579 |
| 1575 void LayerImpl::NotifyAnimationFinished( | 1580 void LayerImpl::NotifyAnimationFinished( |
| 1576 base::TimeTicks monotonic_time, | 1581 base::TimeTicks monotonic_time, |
| 1577 Animation::TargetProperty target_property) { | 1582 Animation::TargetProperty target_property) { |
| 1578 if (target_property == Animation::ScrollOffset) | 1583 if (target_property == Animation::ScrollOffset) |
| 1579 layer_tree_impl_->InputScrollAnimationFinished(); | 1584 layer_tree_impl_->InputScrollAnimationFinished(); |
| 1580 } | 1585 } |
| 1581 | 1586 |
| 1582 } // namespace cc | 1587 } // namespace cc |
| OLD | NEW |