Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: cc/trees/layer_tree_host_impl.cc

Issue 1251323002: Plumb smooth scrolling in Chromium compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1844 matching lines...) Expand 10 before | Expand all | Expand 10 after
1855 1855
1856 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const { 1856 LayerImpl* LayerTreeHostImpl::OuterViewportScrollLayer() const {
1857 return active_tree_->OuterViewportScrollLayer(); 1857 return active_tree_->OuterViewportScrollLayer();
1858 } 1858 }
1859 1859
1860 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const { 1860 LayerImpl* LayerTreeHostImpl::CurrentlyScrollingLayer() const {
1861 return active_tree_->CurrentlyScrollingLayer(); 1861 return active_tree_->CurrentlyScrollingLayer();
1862 } 1862 }
1863 1863
1864 bool LayerTreeHostImpl::IsActivelyScrolling() const { 1864 bool LayerTreeHostImpl::IsActivelyScrolling() const {
1865 return (did_lock_scrolling_layer_ && CurrentlyScrollingLayer()) || 1865 return did_lock_scrolling_layer_ && CurrentlyScrollingLayer();
1866 (InnerViewportScrollLayer() &&
1867 InnerViewportScrollLayer()->IsExternalScrollActive()) ||
1868 (OuterViewportScrollLayer() &&
1869 OuterViewportScrollLayer()->IsExternalScrollActive());
1870 } 1866 }
1871 1867
1872 // Content layers can be either directly scrollable or contained in an outer 1868 // Content layers can be either directly scrollable or contained in an outer
1873 // scrolling layer which applies the scroll transform. Given a content layer, 1869 // scrolling layer which applies the scroll transform. Given a content layer,
1874 // this function returns the associated scroll layer if any. 1870 // this function returns the associated scroll layer if any.
1875 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) { 1871 static LayerImpl* FindScrollLayerForContentLayer(LayerImpl* layer_impl) {
1876 if (!layer_impl) 1872 if (!layer_impl)
1877 return NULL; 1873 return NULL;
1878 1874
1879 if (layer_impl->scrollable()) 1875 if (layer_impl->scrollable())
(...skipping 1732 matching lines...) Expand 10 before | Expand all | Expand 10 after
3612 if (active_tree()) { 3608 if (active_tree()) {
3613 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id); 3609 LayerAnimationValueProvider* layer = active_tree()->LayerById(layer_id);
3614 if (layer) 3610 if (layer)
3615 return layer->ScrollOffsetForAnimation(); 3611 return layer->ScrollOffsetForAnimation();
3616 } 3612 }
3617 3613
3618 return gfx::ScrollOffset(); 3614 return gfx::ScrollOffset();
3619 } 3615 }
3620 3616
3621 } // namespace cc 3617 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698