| 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 2222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2233 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta); | 2233 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta); |
| 2234 } | 2234 } |
| 2235 | 2235 |
| 2236 // If the layer wasn't able to move, try the next one in the hierarchy. | 2236 // If the layer wasn't able to move, try the next one in the hierarchy. |
| 2237 float move_threshold = 0.1f; | 2237 float move_threshold = 0.1f; |
| 2238 bool did_move_layer_x = std::abs(applied_delta.x()) > move_threshold; | 2238 bool did_move_layer_x = std::abs(applied_delta.x()) > move_threshold; |
| 2239 bool did_move_layer_y = std::abs(applied_delta.y()) > move_threshold; | 2239 bool did_move_layer_y = std::abs(applied_delta.y()) > move_threshold; |
| 2240 did_scroll_x |= did_move_layer_x; | 2240 did_scroll_x |= did_move_layer_x; |
| 2241 did_scroll_y |= did_move_layer_y; | 2241 did_scroll_y |= did_move_layer_y; |
| 2242 if (!did_move_layer_x && !did_move_layer_y) { | 2242 if (!did_move_layer_x && !did_move_layer_y) { |
| 2243 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_) | 2243 // Scrolls should always bubble between the outer and inner viewports |
| 2244 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_ || |
| 2245 layer_impl == OuterViewportScrollLayer()) |
| 2244 continue; | 2246 continue; |
| 2245 else | 2247 else |
| 2246 break; | 2248 break; |
| 2247 } | 2249 } |
| 2248 | 2250 |
| 2249 if (layer_impl == InnerViewportScrollLayer()) | 2251 if (layer_impl == InnerViewportScrollLayer()) |
| 2250 unused_root_delta.Subtract(applied_delta); | 2252 unused_root_delta.Subtract(applied_delta); |
| 2251 | 2253 |
| 2252 did_lock_scrolling_layer_ = true; | 2254 did_lock_scrolling_layer_ = true; |
| 2253 if (!should_bubble_scrolls_) { | 2255 if (!should_bubble_scrolls_) { |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3000 swap_promise_monitor_.erase(monitor); | 3002 swap_promise_monitor_.erase(monitor); |
| 3001 } | 3003 } |
| 3002 | 3004 |
| 3003 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { | 3005 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { |
| 3004 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3006 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
| 3005 for (; it != swap_promise_monitor_.end(); it++) | 3007 for (; it != swap_promise_monitor_.end(); it++) |
| 3006 (*it)->OnSetNeedsRedrawOnImpl(); | 3008 (*it)->OnSetNeedsRedrawOnImpl(); |
| 3007 } | 3009 } |
| 3008 | 3010 |
| 3009 } // namespace cc | 3011 } // namespace cc |
| OLD | NEW |