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

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

Issue 1038173002: Refactor delegated scrolling in LayerImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added a new test for Inner/Outer viewport scrolling Created 5 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
« no previous file with comments | « cc/layers/layer_impl_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 #include <map> 9 #include <map>
10 10
(...skipping 2743 matching lines...) Expand 10 before | Expand all | Expand 10 after
2754 2754
2755 void LayerTreeHostImpl::SetRootLayerScrollOffsetDelegate( 2755 void LayerTreeHostImpl::SetRootLayerScrollOffsetDelegate(
2756 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { 2756 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
2757 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; 2757 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
2758 active_tree_->SetRootLayerScrollOffsetDelegate( 2758 active_tree_->SetRootLayerScrollOffsetDelegate(
2759 root_layer_scroll_offset_delegate_); 2759 root_layer_scroll_offset_delegate_);
2760 } 2760 }
2761 2761
2762 void LayerTreeHostImpl::OnRootLayerDelegatedScrollOffsetChanged() { 2762 void LayerTreeHostImpl::OnRootLayerDelegatedScrollOffsetChanged() {
2763 DCHECK(root_layer_scroll_offset_delegate_); 2763 DCHECK(root_layer_scroll_offset_delegate_);
2764 active_tree_->DistributeRootScrollOffset();
2764 client_->SetNeedsCommitOnImplThread(); 2765 client_->SetNeedsCommitOnImplThread();
2765 SetNeedsRedraw(); 2766 SetNeedsRedraw();
2766 active_tree_->OnRootLayerDelegatedScrollOffsetChanged();
2767 active_tree_->set_needs_update_draw_properties(); 2767 active_tree_->set_needs_update_draw_properties();
2768 } 2768 }
2769 2769
2770 void LayerTreeHostImpl::ClearCurrentlyScrollingLayer() { 2770 void LayerTreeHostImpl::ClearCurrentlyScrollingLayer() {
2771 active_tree_->ClearCurrentlyScrollingLayer(); 2771 active_tree_->ClearCurrentlyScrollingLayer();
2772 did_lock_scrolling_layer_ = false; 2772 did_lock_scrolling_layer_ = false;
2773 scroll_affects_scroll_handler_ = false; 2773 scroll_affects_scroll_handler_ = false;
2774 accumulated_root_overscroll_ = gfx::Vector2dF(); 2774 accumulated_root_overscroll_ = gfx::Vector2dF();
2775 } 2775 }
2776 2776
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
3430 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3430 new_target.SetToMin(layer_impl->MaxScrollOffset());
3431 3431
3432 curve->UpdateTarget( 3432 curve->UpdateTarget(
3433 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3433 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3434 .InSecondsF(), 3434 .InSecondsF(),
3435 new_target); 3435 new_target);
3436 3436
3437 return true; 3437 return true;
3438 } 3438 }
3439 } // namespace cc 3439 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer_impl_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