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

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

Issue 737943002: Update from https://crrev.com/304715 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 2549 matching lines...) Expand 10 before | Expand all | Expand 10 after
2560 return InputHandlerScrollResult(); 2560 return InputHandlerScrollResult();
2561 2561
2562 gfx::Vector2dF pending_delta = scroll_delta; 2562 gfx::Vector2dF pending_delta = scroll_delta;
2563 gfx::Vector2dF unused_root_delta; 2563 gfx::Vector2dF unused_root_delta;
2564 bool did_scroll_x = false; 2564 bool did_scroll_x = false;
2565 bool did_scroll_y = false; 2565 bool did_scroll_y = false;
2566 bool did_scroll_top_controls = false; 2566 bool did_scroll_top_controls = false;
2567 2567
2568 bool consume_by_top_controls = ShouldTopControlsConsumeScroll(scroll_delta); 2568 bool consume_by_top_controls = ShouldTopControlsConsumeScroll(scroll_delta);
2569 2569
2570 for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); 2570 // There's an edge case where the outer viewport isn't scrollable when the
2571 // scroll starts, however, as the top controls show the outer viewport becomes
2572 // scrollable. Therefore, always try scrolling the outer viewport before the
2573 // inner.
2574 // TODO(bokan): Move the top controls logic out of the loop since the scroll
2575 // that causes the outer viewport to become scrollable will still be applied
2576 // to the inner viewport.
2577 LayerImpl* start_layer = CurrentlyScrollingLayer();
2578 if (start_layer == InnerViewportScrollLayer() && OuterViewportScrollLayer())
2579 start_layer = OuterViewportScrollLayer();
2580
2581 for (LayerImpl* layer_impl = start_layer;
2571 layer_impl; 2582 layer_impl;
2572 layer_impl = layer_impl->parent()) { 2583 layer_impl = layer_impl->parent()) {
2573 if (!layer_impl->scrollable()) 2584 if (!layer_impl->scrollable())
2574 continue; 2585 continue;
2575 2586
2576 if (layer_impl == InnerViewportScrollLayer() || 2587 if (layer_impl == InnerViewportScrollLayer() ||
2577 layer_impl == OuterViewportScrollLayer()) { 2588 layer_impl == OuterViewportScrollLayer()) {
2578 if (consume_by_top_controls) { 2589 if (consume_by_top_controls) {
2579 gfx::Vector2dF excess_delta = 2590 gfx::Vector2dF excess_delta =
2580 top_controls_manager_->ScrollBy(pending_delta); 2591 top_controls_manager_->ScrollBy(pending_delta);
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
3431 } 3442 }
3432 3443
3433 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3444 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3434 std::vector<PictureLayerImpl*>::iterator it = 3445 std::vector<PictureLayerImpl*>::iterator it =
3435 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3446 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3436 DCHECK(it != picture_layers_.end()); 3447 DCHECK(it != picture_layers_.end());
3437 picture_layers_.erase(it); 3448 picture_layers_.erase(it);
3438 } 3449 }
3439 3450
3440 } // namespace cc 3451 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common_unittest.cc ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698