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

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

Issue 1808373002: cc : Make tree synchronization independent of layer tree hierarchy (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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.cc ('k') | cc/trees/layer_tree_host_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 1956 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698