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

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: format 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
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 3001 matching lines...) Expand 10 before | Expand all | Expand 10 after
3012 scroll_info->scrolls.push_back(scroll); 3012 scroll_info->scrolls.push_back(scroll);
3013 } 3013 }
3014 3014
3015 for (size_t i = 0; i < layer_impl->children().size(); ++i) 3015 for (size_t i = 0; i < layer_impl->children().size(); ++i)
3016 CollectScrollDeltas(scroll_info, layer_impl->children()[i]); 3016 CollectScrollDeltas(scroll_info, layer_impl->children()[i]);
3017 } 3017 }
3018 3018
3019 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { 3019 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
3020 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); 3020 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
3021 3021
3022 if (root_layer_scroll_offset_delegate_)
3023 root_layer_scroll_offset_delegate_->SetBlockUpdates(true);
3022 CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer()); 3024 CollectScrollDeltas(scroll_info.get(), active_tree_->root_layer());
3025 if (root_layer_scroll_offset_delegate_)
3026 root_layer_scroll_offset_delegate_->SetBlockUpdates(false);
3027
3028 active_tree_->UpdateScrollOffsetDelegateIfNeeded();
3029
3023 scroll_info->page_scale_delta = 3030 scroll_info->page_scale_delta =
3024 active_tree_->page_scale_factor()->PullDeltaForMainThread(); 3031 active_tree_->page_scale_factor()->PullDeltaForMainThread();
3025 scroll_info->top_controls_delta = 3032 scroll_info->top_controls_delta =
3026 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); 3033 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread();
3027 scroll_info->elastic_overscroll_delta = 3034 scroll_info->elastic_overscroll_delta =
3028 active_tree_->elastic_overscroll()->PullDeltaForMainThread(); 3035 active_tree_->elastic_overscroll()->PullDeltaForMainThread();
3029 scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_); 3036 scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_);
3030 3037
3031 return scroll_info.Pass(); 3038 return scroll_info.Pass();
3032 } 3039 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
3464 new_target.SetToMin(layer_impl->MaxScrollOffset()); 3471 new_target.SetToMin(layer_impl->MaxScrollOffset());
3465 3472
3466 curve->UpdateTarget( 3473 curve->UpdateTarget(
3467 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) 3474 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time)
3468 .InSecondsF(), 3475 .InSecondsF(),
3469 new_target); 3476 new_target);
3470 3477
3471 return true; 3478 return true;
3472 } 3479 }
3473 } // namespace cc 3480 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698