| OLD | NEW |
| 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 3352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3363 callbacks->push_back(callback); | 3363 callbacks->push_back(callback); |
| 3364 } | 3364 } |
| 3365 return callbacks; | 3365 return callbacks; |
| 3366 } | 3366 } |
| 3367 | 3367 |
| 3368 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, | 3368 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, |
| 3369 LayerTreeImpl* tree_impl) { | 3369 LayerTreeImpl* tree_impl) { |
| 3370 if (tree_impl->LayerListIsEmpty()) | 3370 if (tree_impl->LayerListIsEmpty()) |
| 3371 return; | 3371 return; |
| 3372 | 3372 |
| 3373 int inner_viewport_layer_id = |
| 3374 tree_impl->InnerViewportScrollLayer() |
| 3375 ? tree_impl->InnerViewportScrollLayer()->id() |
| 3376 : Layer::INVALID_ID; |
| 3377 |
| 3373 return tree_impl->property_trees()->scroll_tree.CollectScrollDeltas( | 3378 return tree_impl->property_trees()->scroll_tree.CollectScrollDeltas( |
| 3374 scroll_info); | 3379 scroll_info, inner_viewport_layer_id); |
| 3375 } | 3380 } |
| 3376 | 3381 |
| 3377 std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { | 3382 std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { |
| 3378 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); | 3383 std::unique_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); |
| 3379 | 3384 |
| 3380 CollectScrollDeltas(scroll_info.get(), active_tree_.get()); | 3385 CollectScrollDeltas(scroll_info.get(), active_tree_.get()); |
| 3381 scroll_info->page_scale_delta = | 3386 scroll_info->page_scale_delta = |
| 3382 active_tree_->page_scale_factor()->PullDeltaForMainThread(); | 3387 active_tree_->page_scale_factor()->PullDeltaForMainThread(); |
| 3383 scroll_info->top_controls_delta = | 3388 scroll_info->top_controls_delta = |
| 3384 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); | 3389 active_tree()->top_controls_shown_ratio()->PullDeltaForMainThread(); |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4026 return task_runner_provider_->HasImplThread(); | 4031 return task_runner_provider_->HasImplThread(); |
| 4027 } | 4032 } |
| 4028 | 4033 |
| 4029 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4034 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 4030 // In single threaded mode we skip the pending tree and commit directly to the | 4035 // In single threaded mode we skip the pending tree and commit directly to the |
| 4031 // active tree. | 4036 // active tree. |
| 4032 return !task_runner_provider_->HasImplThread(); | 4037 return !task_runner_provider_->HasImplThread(); |
| 4033 } | 4038 } |
| 4034 | 4039 |
| 4035 } // namespace cc | 4040 } // namespace cc |
| OLD | NEW |