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 2539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2550 DCHECK(scroll_on_main_thread); | 2550 DCHECK(scroll_on_main_thread); |
2551 DCHECK(main_thread_scrolling_reasons); | 2551 DCHECK(main_thread_scrolling_reasons); |
2552 *main_thread_scrolling_reasons = | 2552 *main_thread_scrolling_reasons = |
2553 MainThreadScrollingReason::kNotScrollingOnMain; | 2553 MainThreadScrollingReason::kNotScrollingOnMain; |
2554 | 2554 |
2555 // Walk up the hierarchy and look for a scrollable layer. | 2555 // Walk up the hierarchy and look for a scrollable layer. |
2556 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; | 2556 ScrollTree& scroll_tree = active_tree_->property_trees()->scroll_tree; |
2557 LayerImpl* potentially_scrolling_layer_impl = NULL; | 2557 LayerImpl* potentially_scrolling_layer_impl = NULL; |
2558 if (layer_impl) { | 2558 if (layer_impl) { |
2559 ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index()); | 2559 ScrollNode* scroll_node = scroll_tree.Node(layer_impl->scroll_tree_index()); |
2560 for (; scroll_tree.parent(scroll_node); | 2560 for (; scroll_node; scroll_node = scroll_tree.parent(scroll_node)) { |
2561 scroll_node = scroll_tree.parent(scroll_node)) { | |
2562 // The content layer can also block attempts to scroll outside the main | 2561 // The content layer can also block attempts to scroll outside the main |
2563 // thread. | 2562 // thread. |
2564 ScrollStatus status = | 2563 ScrollStatus status = |
2565 TryScroll(device_viewport_point, type, scroll_tree, scroll_node); | 2564 TryScroll(device_viewport_point, type, scroll_tree, scroll_node); |
2566 if (IsMainThreadScrolling(status, scroll_node)) { | 2565 if (IsMainThreadScrolling(status, scroll_node)) { |
2567 *scroll_on_main_thread = true; | 2566 *scroll_on_main_thread = true; |
2568 *main_thread_scrolling_reasons = status.main_thread_scrolling_reasons; | 2567 *main_thread_scrolling_reasons = status.main_thread_scrolling_reasons; |
2569 return NULL; | 2568 return NULL; |
2570 } | 2569 } |
2571 | 2570 |
(...skipping 1454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 return task_runner_provider_->HasImplThread(); | 4025 return task_runner_provider_->HasImplThread(); |
4027 } | 4026 } |
4028 | 4027 |
4029 bool LayerTreeHostImpl::CommitToActiveTree() const { | 4028 bool LayerTreeHostImpl::CommitToActiveTree() const { |
4030 // In single threaded mode we skip the pending tree and commit directly to the | 4029 // In single threaded mode we skip the pending tree and commit directly to the |
4031 // active tree. | 4030 // active tree. |
4032 return !task_runner_provider_->HasImplThread(); | 4031 return !task_runner_provider_->HasImplThread(); |
4033 } | 4032 } |
4034 | 4033 |
4035 } // namespace cc | 4034 } // namespace cc |
OLD | NEW |