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

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

Issue 661643004: [android] Remove unused scroll delta in TopControls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unittest Added Created 6 years, 2 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
« no previous file with comments | « AUTHORS ('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 2567 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 return false; 2578 return false;
2579 2579
2580 // Always consume if it's in the direction to show the top controls. 2580 // Always consume if it's in the direction to show the top controls.
2581 if (scroll_delta.y() < 0) 2581 if (scroll_delta.y() < 0)
2582 return true; 2582 return true;
2583 2583
2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() && 2584 if (CurrentlyScrollingLayer() != InnerViewportScrollLayer() &&
2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer()) 2585 CurrentlyScrollingLayer() != OuterViewportScrollLayer())
2586 return false; 2586 return false;
2587 2587
2588 // Avoid confusing top controls bookkeeping with positive overscroll deltas.
2589 if (scroll_delta.y() > 0 && top_controls_manager_->ContentTopOffset() == 0 &&
2590 (InnerViewportScrollLayer()->TotalScrollOffset().y() ==
aelias_OOO_until_Jul13 2014/10/22 18:40:47 This should check OuterViewportScrollLayer as well
sujith 2014/10/23 06:57:10 Done.
2591 InnerViewportScrollLayer()->MaxScrollOffset().y()))
2592 return false;
2593
2588 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0) 2594 if (InnerViewportScrollLayer()->MaxScrollOffset().y() > 0)
2589 return true; 2595 return true;
2590 2596
2591 if (OuterViewportScrollLayer() && 2597 if (OuterViewportScrollLayer() &&
2592 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0) 2598 OuterViewportScrollLayer()->MaxScrollOffset().y() > 0)
2593 return true; 2599 return true;
2594 2600
2595 return false; 2601 return false;
2596 } 2602 }
2597 2603
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
3473 } 3479 }
3474 3480
3475 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3476 std::vector<PictureLayerImpl*>::iterator it = 3482 std::vector<PictureLayerImpl*>::iterator it =
3477 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3478 DCHECK(it != picture_layers_.end()); 3484 DCHECK(it != picture_layers_.end());
3479 picture_layers_.erase(it); 3485 picture_layers_.erase(it);
3480 } 3486 }
3481 3487
3482 } // namespace cc 3488 } // namespace cc
OLDNEW
« no previous file with comments | « AUTHORS ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698