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 1895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1906 } | 1906 } |
1907 | 1907 |
1908 static LayerImpl* NextScrollLayer(LayerImpl* layer) { | 1908 static LayerImpl* NextScrollLayer(LayerImpl* layer) { |
1909 if (LayerImpl* scroll_parent = layer->scroll_parent()) | 1909 if (LayerImpl* scroll_parent = layer->scroll_parent()) |
1910 return scroll_parent; | 1910 return scroll_parent; |
1911 return layer->parent(); | 1911 return layer->parent(); |
1912 } | 1912 } |
1913 | 1913 |
1914 LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint( | 1914 LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint( |
1915 gfx::PointF device_viewport_point, InputHandler::ScrollInputType type, | 1915 gfx::PointF device_viewport_point, InputHandler::ScrollInputType type, |
1916 LayerImpl* layer_impl, bool* scroll_on_main_thread) { | 1916 LayerImpl* layer_impl, bool* scroll_on_main_thread) const { |
1917 DCHECK(scroll_on_main_thread); | 1917 DCHECK(scroll_on_main_thread); |
1918 | 1918 |
1919 // Walk up the hierarchy and look for a scrollable layer. | 1919 // Walk up the hierarchy and look for a scrollable layer. |
1920 LayerImpl* potentially_scrolling_layer_impl = 0; | 1920 LayerImpl* potentially_scrolling_layer_impl = 0; |
1921 for (; layer_impl; layer_impl = NextScrollLayer(layer_impl)) { | 1921 for (; layer_impl; layer_impl = NextScrollLayer(layer_impl)) { |
1922 // The content layer can also block attempts to scroll outside the main | 1922 // The content layer can also block attempts to scroll outside the main |
1923 // thread. | 1923 // thread. |
1924 ScrollStatus status = layer_impl->TryScroll(device_viewport_point, type); | 1924 ScrollStatus status = layer_impl->TryScroll(device_viewport_point, type); |
1925 if (status == ScrollOnMainThread) { | 1925 if (status == ScrollOnMainThread) { |
1926 *scroll_on_main_thread = true; | 1926 *scroll_on_main_thread = true; |
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2816 std::set<UIResourceId>::iterator found_in_evicted = | 2816 std::set<UIResourceId>::iterator found_in_evicted = |
2817 evicted_ui_resources_.find(uid); | 2817 evicted_ui_resources_.find(uid); |
2818 if (found_in_evicted == evicted_ui_resources_.end()) | 2818 if (found_in_evicted == evicted_ui_resources_.end()) |
2819 return; | 2819 return; |
2820 evicted_ui_resources_.erase(found_in_evicted); | 2820 evicted_ui_resources_.erase(found_in_evicted); |
2821 if (evicted_ui_resources_.empty()) | 2821 if (evicted_ui_resources_.empty()) |
2822 client_->OnCanDrawStateChanged(CanDraw()); | 2822 client_->OnCanDrawStateChanged(CanDraw()); |
2823 } | 2823 } |
2824 | 2824 |
2825 } // namespace cc | 2825 } // namespace cc |
OLD | NEW |