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

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

Issue 230223006: Move nonscrollable axis gloweffect suppression to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changes done after review comments Created 6 years, 8 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 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2306 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta); 2306 applied_delta = ScrollLayerWithLocalDelta(layer_impl, pending_delta);
2307 } 2307 }
2308 2308
2309 const float kEpsilon = 0.1f; 2309 const float kEpsilon = 0.1f;
2310 if (layer_impl == InnerViewportScrollLayer()) { 2310 if (layer_impl == InnerViewportScrollLayer()) {
2311 unused_root_delta.Subtract(applied_delta); 2311 unused_root_delta.Subtract(applied_delta);
2312 if (std::abs(unused_root_delta.x()) < kEpsilon) 2312 if (std::abs(unused_root_delta.x()) < kEpsilon)
2313 unused_root_delta.set_x(0.0f); 2313 unused_root_delta.set_x(0.0f);
2314 if (std::abs(unused_root_delta.y()) < kEpsilon) 2314 if (std::abs(unused_root_delta.y()) < kEpsilon)
2315 unused_root_delta.set_y(0.0f); 2315 unused_root_delta.set_y(0.0f);
2316 // Disable overscroll on axes which is impossible to scroll.
2317 if (settings_.report_overscroll_only_for_scrollable_axes) {
2318 gfx::SizeF ceiled_viewport_size =
jdduke (slow) 2014/04/10 14:16:02 You shouldn't need to check both viewport size and
2319 gfx::ToCeiledSize(active_tree_->ScrollableViewportSize());
2320 gfx::SizeF root_layer_size = active_tree_->ScrollableSize();
2321 if (!(ceiled_viewport_size.width() < root_layer_size.width())) {
2322 if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().x()) <= 0)
aelias_OOO_until_Jul13 2014/04/10 16:28:37 Please also check OuterViewportScrollLayer as I me
2323 unused_root_delta.set_x(0.0f);
2324 }
2325 if (!(ceiled_viewport_size.height() < root_layer_size.height())) {
2326 if (std::abs(InnerViewportScrollLayer()->MaxScrollOffset().y()) <= 0)
2327 unused_root_delta.set_y(0.0f);
2328 }
2329 }
2316 } 2330 }
2317 2331
2318 // If the layer wasn't able to move, try the next one in the hierarchy. 2332 // If the layer wasn't able to move, try the next one in the hierarchy.
2319 bool did_move_layer_x = std::abs(applied_delta.x()) > kEpsilon; 2333 bool did_move_layer_x = std::abs(applied_delta.x()) > kEpsilon;
2320 bool did_move_layer_y = std::abs(applied_delta.y()) > kEpsilon; 2334 bool did_move_layer_y = std::abs(applied_delta.y()) > kEpsilon;
2321 did_scroll_x |= did_move_layer_x; 2335 did_scroll_x |= did_move_layer_x;
2322 did_scroll_y |= did_move_layer_y; 2336 did_scroll_y |= did_move_layer_y;
2323 if (!did_move_layer_x && !did_move_layer_y) { 2337 if (!did_move_layer_x && !did_move_layer_y) {
2324 // Scrolls should always bubble between the outer and inner viewports 2338 // Scrolls should always bubble between the outer and inner viewports
2325 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_ || 2339 if (should_bubble_scrolls_ || !did_lock_scrolling_layer_ ||
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 swap_promise_monitor_.erase(monitor); 3081 swap_promise_monitor_.erase(monitor);
3068 } 3082 }
3069 3083
3070 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() { 3084 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfSetNeedsRedraw() {
3071 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); 3085 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin();
3072 for (; it != swap_promise_monitor_.end(); it++) 3086 for (; it != swap_promise_monitor_.end(); it++)
3073 (*it)->OnSetNeedsRedrawOnImpl(); 3087 (*it)->OnSetNeedsRedrawOnImpl();
3074 } 3088 }
3075 3089
3076 } // namespace cc 3090 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_settings.h » ('j') | content/browser/renderer_host/render_widget_host_view_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698