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

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

Issue 2144303002: Made layout viewport scroll updates from compositor work like ordinary layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerOnCompositor
Patch Set: Initialize ScrollUpdateInfo's layer id in constructor Created 4 years, 5 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/trees/layer_tree_host_common.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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 3348 matching lines...) Expand 10 before | Expand all | Expand 10 after
3359 callbacks->push_back(callback); 3359 callbacks->push_back(callback);
3360 } 3360 }
3361 return callbacks; 3361 return callbacks;
3362 } 3362 }
3363 3363
3364 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, 3364 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
3365 LayerTreeImpl* tree_impl) { 3365 LayerTreeImpl* tree_impl) {
3366 if (tree_impl->LayerListIsEmpty()) 3366 if (tree_impl->LayerListIsEmpty())
3367 return; 3367 return;
3368 3368
3369 int inner_viewport_layer_id =
3370 tree_impl->InnerViewportScrollLayer()
3371 ? tree_impl->InnerViewportScrollLayer()->id()
3372 : Layer::INVALID_ID;
3373
3369 return tree_impl->property_trees()->scroll_tree.CollectScrollDeltas( 3374 return tree_impl->property_trees()->scroll_tree.CollectScrollDeltas(
3370 scroll_info); 3375 scroll_info, inner_viewport_layer_id);
3371 } 3376 }
3372 3377
3373 std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { 3378 std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
3374 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); 3379 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
3375 3380
3376 CollectScrollDeltas(scroll_info.get(), active_tree_.get()); 3381 CollectScrollDeltas(scroll_info.get(), active_tree_.get());
3377 scroll_info->page_scale_delta = 3382 scroll_info->page_scale_delta =
3378 active_tree_->page_scale_factor()->PullDeltaForMainThread(); 3383 active_tree_->page_scale_factor()->PullDeltaForMainThread();
3379 scroll_info->top_controls_delta = 3384 scroll_info->top_controls_delta =
3380 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); 3385 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread();
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after
4022 return task_runner_provider_->HasImplThread(); 4027 return task_runner_provider_->HasImplThread();
4023 } 4028 }
4024 4029
4025 bool LayerTreeHostImpl::CommitToActiveTree() const { 4030 bool LayerTreeHostImpl::CommitToActiveTree() const {
4026 // In single threaded mode we skip the pending tree and commit directly to the 4031 // In single threaded mode we skip the pending tree and commit directly to the
4027 // active tree. 4032 // active tree.
4028 return !task_runner_provider_->HasImplThread(); 4033 return !task_runner_provider_->HasImplThread();
4029 } 4034 }
4030 4035
4031 } // namespace cc 4036 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.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