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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 ScrollDelta() + scroll - new_delta; | 376 ScrollDelta() + scroll - new_delta; |
377 SetScrollDelta(new_delta); | 377 SetScrollDelta(new_delta); |
378 | 378 |
379 return unscrolled; | 379 return unscrolled; |
380 } | 380 } |
381 | 381 |
382 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { | 382 void LayerImpl::SetScrollClipLayer(int scroll_clip_layer_id) { |
383 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); | 383 scroll_clip_layer_ = layer_tree_impl()->LayerById(scroll_clip_layer_id); |
384 } | 384 } |
385 | 385 |
| 386 bool LayerImpl::user_scrollable(ScrollbarOrientation orientation) const { |
| 387 return (orientation == HORIZONTAL) ? user_scrollable_horizontal_ |
| 388 : user_scrollable_vertical_; |
| 389 } |
| 390 |
386 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { | 391 void LayerImpl::ApplySentScrollDeltasFromAbortedCommit() { |
387 // Pending tree never has sent scroll deltas | 392 // Pending tree never has sent scroll deltas |
388 DCHECK(layer_tree_impl()->IsActiveTree()); | 393 DCHECK(layer_tree_impl()->IsActiveTree()); |
389 | 394 |
390 // Apply sent scroll deltas to scroll position / scroll delta as if the | 395 // Apply sent scroll deltas to scroll position / scroll delta as if the |
391 // main thread had applied them and then committed those values. | 396 // main thread had applied them and then committed those values. |
392 // | 397 // |
393 // This function should not change the total scroll offset; it just shifts | 398 // This function should not change the total scroll offset; it just shifts |
394 // some of the scroll delta to the scroll offset. Therefore, adjust these | 399 // some of the scroll delta to the scroll offset. Therefore, adjust these |
395 // variables directly rather than calling the scroll offset delegate to | 400 // variables directly rather than calling the scroll offset delegate to |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1556 } | 1561 } |
1557 | 1562 |
1558 void LayerImpl::NotifyAnimationFinished( | 1563 void LayerImpl::NotifyAnimationFinished( |
1559 base::TimeTicks monotonic_time, | 1564 base::TimeTicks monotonic_time, |
1560 Animation::TargetProperty target_property) { | 1565 Animation::TargetProperty target_property) { |
1561 if (target_property == Animation::ScrollOffset) | 1566 if (target_property == Animation::ScrollOffset) |
1562 layer_tree_impl_->InputScrollAnimationFinished(); | 1567 layer_tree_impl_->InputScrollAnimationFinished(); |
1563 } | 1568 } |
1564 | 1569 |
1565 } // namespace cc | 1570 } // namespace cc |
OLD | NEW |