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 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2578 return false; | 2578 return false; |
2579 | 2579 |
2580 // Always consume if it's in the direction to show the top controls. | 2580 // Always consume if it's in the direction to show the top controls. |
2581 if (scroll_delta.y() < 0) | 2581 if (scroll_delta.y() < 0) |
2582 return true; | 2582 return true; |
2583 | 2583 |
2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && | 2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && |
2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) | 2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) |
2586 return false; | 2586 return false; |
2587 | 2587 |
2588 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) | 2588 if (active_tree()->TotalScrollOffset().y() < |
2589 return true; | 2589 active_tree()->TotalMaxScrollOffset().y()) |
2590 | |
2591 if (OuterViewportScrollLayer() && | |
2592 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) | |
2593 return true; | 2590 return true; |
2594 | 2591 |
2595 return false; | 2592 return false; |
2596 } | 2593 } |
2597 | 2594 |
2598 bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, | 2595 bool LayerTreeHostImpl::ScrollBy(const gfx::Point& viewport_point, |
2599 const gfx::Vector2dF& scroll_delta) { | 2596 const gfx::Vector2dF& scroll_delta) { |
2600 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); | 2597 TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBy"); |
2601 if (!CurrentlyScrollingLayer()) | 2598 if (!CurrentlyScrollingLayer()) |
2602 return false; | 2599 return false; |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3473 } | 3470 } |
3474 | 3471 |
3475 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 3472 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
3476 std::vector<PictureLayerImpl*>::iterator it = | 3473 std::vector<PictureLayerImpl*>::iterator it = |
3477 std::find(picture_layers_.begin(), picture_layers_.end(), layer); | 3474 std::find(picture_layers_.begin(), picture_layers_.end(), layer); |
3478 DCHECK(it != picture_layers_.end()); | 3475 DCHECK(it != picture_layers_.end()); |
3479 picture_layers_.erase(it); | 3476 picture_layers_.erase(it); |
3480 } | 3477 } |
3481 | 3478 |
3482 } // namespace cc | 3479 } // namespace cc |
OLD | NEW |