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 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2217 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta); | 2217 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta); |
2218 } | 2218 } |
2219 | 2219 |
2220 // If the layer wasn't able to move, try the next one in the hierarchy. | 2220 // If the layer wasn't able to move, try the next one in the hierarchy. |
2221 float move_threshold = 0.1f; | 2221 float move_threshold = 0.1f; |
2222 bool did_move_layer_x = std::abs(applied_delta.x()) > move_threshold; | 2222 bool did_move_layer_x = std::abs(applied_delta.x()) > move_threshold; |
2223 bool did_move_layer_y = std::abs(applied_delta.y()) > move_threshold; | 2223 bool did_move_layer_y = std::abs(applied_delta.y()) > move_threshold; |
2224 did_scroll_x |= did_move_layer_x; | 2224 did_scroll_x |= did_move_layer_x; |
2225 did_scroll_y |= did_move_layer_y; | 2225 did_scroll_y |= did_move_layer_y; |
2226 if (!did_move_layer_x && !did_move_layer_y) { | 2226 if (!did_move_layer_x && !did_move_layer_y) { |
2227 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_) | 2227 // Scrolls should always bubble between the outer and inner viewports |
| 2228 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_ || |
| 2229 layer_impl == OuterViewportScrollLayer()) |
2228 continue; | 2230 continue; |
2229 else | 2231 else |
2230 break; | 2232 break; |
2231 } | 2233 } |
2232 | 2234 |
2233 if (layer_impl == InnerViewportScrollLayer()) | 2235 if (layer_impl == InnerViewportScrollLayer()) |
2234 unused_root_delta.Subtract(applied_delta); | 2236 unused_root_delta.Subtract(applied_delta); |
2235 | 2237 |
2236 did_lock_scrolling_layer_ = true; | 2238 did_lock_scrolling_layer_ = true; |
2237 if (!should_bubble_scrolls_) { | 2239 if (!should_bubble_scrolls_) { |
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2979 swap_promise_monitor_.erase(monitor); | 2981 swap_promise_monitor_.erase(monitor); |
2980 } | 2982 } |
2981 | 2983 |
2982 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 2984 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
2983 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 2985 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
2984 for (; it != swap_promise_monitor_.end(); it++) | 2986 for (; it != swap_promise_monitor_.end(); it++) |
2985 (*it)->OnSetNeedsRedrawOnImpl(); | 2987 (*it)->OnSetNeedsRedrawOnImpl(); |
2986 } | 2988 } |
2987 | 2989 |
2988 } // namespace cc | 2990 } // namespace cc |
OLD | NEW |