| 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 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 1848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1859 | 1859 |
| 1860 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { | 1860 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { |
| 1861 return active_tree_->OuterViewportScrollLayer(); | 1861 return active_tree_->OuterViewportScrollLayer(); |
| 1862 } | 1862 } |
| 1863 | 1863 |
| 1864 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { | 1864 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { |
| 1865 return active_tree_->CurrentlyScrollingLayer(); | 1865 return active_tree_->CurrentlyScrollingLayer(); |
| 1866 } | 1866 } |
| 1867 | 1867 |
| 1868 bool LayerTreeHostImpl::IsActivelyScrolling() const { | 1868 bool LayerTreeHostImpl::IsActivelyScrolling() const { |
| 1869 return (did_lock_scrolling_layer_ && CurrentlyScrollingLayer()) || | 1869 return did_lock_scrolling_layer_ && CurrentlyScrollingLayer(); |
| 1870 (InnerViewportScrollLayer() && | |
| 1871 InnerViewportScrollLayer()->IsExternalScrollActive()) || | |
| 1872 (OuterViewportScrollLayer() && | |
| 1873 OuterViewportScrollLayer()->IsExternalScrollActive()); | |
| 1874 } | 1870 } |
| 1875 | 1871 |
| 1876 // Content layers can be either directly scrollable or contained in an outer | 1872 // Content layers can be either directly scrollable or contained in an outer |
| 1877 // scrolling layer which applies the scroll transform. Given a content layer, | 1873 // scrolling layer which applies the scroll transform. Given a content layer, |
| 1878 // this function returns the associated scroll layer if any. | 1874 // this function returns the associated scroll layer if any. |
| 1879 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { | 1875 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { |
| 1880 if (!layer_impl) | 1876 if (!layer_impl) |
| 1881 return NULL; | 1877 return NULL; |
| 1882 | 1878 |
| 1883 if (layer_impl->scrollable()) | 1879 if (layer_impl->scrollable()) |
| (...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3616 if (active_tree()) { | 3612 if (active_tree()) { |
| 3617 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); | 3613 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); |
| 3618 if (layer) | 3614 if (layer) |
| 3619 return layer->ScrollOffsetForAnimation(); | 3615 return layer->ScrollOffsetForAnimation(); |
| 3620 } | 3616 } |
| 3621 | 3617 |
| 3622 return gfx::ScrollOffset(); | 3618 return gfx::ScrollOffset(); |
| 3623 } | 3619 } |
| 3624 | 3620 |
| 3625 } // namespace cc | 3621 } // namespace cc |
| OLD | NEW |