| 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 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1967 // to pending tree property trees. | 1967 // to pending tree property trees. |
| 1968 if (active_tree_->property_trees()->changed) { | 1968 if (active_tree_->property_trees()->changed) { |
| 1969 if (pending_tree_->property_trees()->sequence_number == | 1969 if (pending_tree_->property_trees()->sequence_number == |
| 1970 active_tree_->property_trees()->sequence_number) | 1970 active_tree_->property_trees()->sequence_number) |
| 1971 active_tree_->property_trees()->PushChangeTrackingTo( | 1971 active_tree_->property_trees()->PushChangeTrackingTo( |
| 1972 pending_tree_->property_trees()); | 1972 pending_tree_->property_trees()); |
| 1973 else | 1973 else |
| 1974 active_tree_->root_layer()->PushLayerPropertyChangedForSubtree(); | 1974 active_tree_->root_layer()->PushLayerPropertyChangedForSubtree(); |
| 1975 } | 1975 } |
| 1976 | 1976 |
| 1977 std::unordered_set<LayerImpl*> layers_that_should_push_properties = | 1977 TreeSynchronizer::PushLayerProperties(pending_tree(), active_tree()); |
| 1978 pending_tree_->LayersThatShouldPushProperties(); | |
| 1979 for (auto pending_layer : layers_that_should_push_properties) { | |
| 1980 LayerImpl* active_layer = active_tree_->LayerById(pending_layer->id()); | |
| 1981 DCHECK(active_layer); | |
| 1982 pending_layer->PushPropertiesTo(active_layer); | |
| 1983 } | |
| 1984 pending_tree_->PushPropertiesTo(active_tree_.get()); | 1978 pending_tree_->PushPropertiesTo(active_tree_.get()); |
| 1985 if (pending_tree_->root_layer()) | 1979 if (pending_tree_->root_layer()) |
| 1986 pending_tree_->property_trees()->ResetAllChangeTracking( | 1980 pending_tree_->property_trees()->ResetAllChangeTracking( |
| 1987 PropertyTrees::ResetFlags::ALL_TREES); | 1981 PropertyTrees::ResetFlags::ALL_TREES); |
| 1988 | 1982 |
| 1989 // Now that we've synced everything from the pending tree to the active | 1983 // Now that we've synced everything from the pending tree to the active |
| 1990 // tree, rename the pending tree the recycle tree so we can reuse it on the | 1984 // tree, rename the pending tree the recycle tree so we can reuse it on the |
| 1991 // next sync. | 1985 // next sync. |
| 1992 DCHECK(!recycle_tree_); | 1986 DCHECK(!recycle_tree_); |
| 1993 pending_tree_.swap(recycle_tree_); | 1987 pending_tree_.swap(recycle_tree_); |
| (...skipping 1934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3928 return task_runner_provider_->HasImplThread(); | 3922 return task_runner_provider_->HasImplThread(); |
| 3929 } | 3923 } |
| 3930 | 3924 |
| 3931 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3925 bool LayerTreeHostImpl::CommitToActiveTree() const { |
| 3932 // In single threaded mode we skip the pending tree and commit directly to the | 3926 // In single threaded mode we skip the pending tree and commit directly to the |
| 3933 // active tree. | 3927 // active tree. |
| 3934 return !task_runner_provider_->HasImplThread(); | 3928 return !task_runner_provider_->HasImplThread(); |
| 3935 } | 3929 } |
| 3936 | 3930 |
| 3937 } // namespace cc | 3931 } // namespace cc |
| OLD | NEW |