OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 return false; | 2621 return false; |
2622 | 2622 |
2623 // Always consume if it's in the direction to show the top controls. | 2623 // Always consume if it's in the direction to show the top controls. |
2624 if (scroll_delta.y() < 0) | 2624 if (scroll_delta.y() < 0) |
2625 return true; | 2625 return true; |
2626 | 2626 |
2627 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && | 2627 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && |
2628 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) | 2628 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) |
2629 return false; | 2629 return false; |
2630 | 2630 |
2631 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2631 if (active_tree()->TotalScrollOffset().y() < |
2632 return true; | 2632 active_tree()->TotalMaxScrollOffset().y()) |
2633 | |
2634 if (OuterViewportScrollLayer() && | |
2635 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) | |
2636 return true; | 2633 return true; |
2637 | 2634 |
2638 return false; | 2635 return false; |
2639 } | 2636 } |
2640 | 2637 |
2641 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( | 2638 InputHandlerScrollResult LayerTreeHostImpl::ScrollBy( |
2642 const gfx::Point& viewport_point, | 2639 const gfx::Point& viewport_point, |
2643 const gfx::Vector2dF& scroll_delta) { | 2640 const gfx::Vector2dF& scroll_delta) { |
2644 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); | 2641 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); |
2645 if (!CurrentlyScrollingLayer()) | 2642 if (!CurrentlyScrollingLayer()) |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3522 } | 3519 } |
3523 | 3520 |
3524 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3521 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3525 std::vector<PictureLayerImpl*>::iterator it = | 3522 std::vector<PictureLayerImpl*>::iterator it = |
3526 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3523 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3527 DCHECK(it != picture_layers_.end()); | 3524 DCHECK(it != picture_layers_.end()); |
3528 picture_layers_.erase(it); | 3525 picture_layers_.erase(it); |
3529 } | 3526 } |
3530 | 3527 |
3531 } // namespace cc | 3528 } // namespace cc |
OLD | NEW |