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