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

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

Issue 2048863003: Reland of cc : Make LayerImpl destruction independent of tree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_impl.cc ('k') | cc/trees/tree_synchronizer_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/tree_synchronizer.h" 5 #include "cc/trees/tree_synchronizer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 25 matching lines...) Expand all
36 // Need to ensure that layer destruction doesn't tear down other layers 36 // Need to ensure that layer destruction doesn't tear down other layers
37 // linked to this LayerImpl that have been used in the new tree. 37 // linked to this LayerImpl that have been used in the new tree.
38 it.second->ClearLinksToOtherLayers(); 38 it.second->ClearLinksToOtherLayers();
39 } 39 }
40 } 40 }
41 } 41 }
42 42
43 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root, 43 void TreeSynchronizer::SynchronizeTrees(Layer* layer_root,
44 LayerTreeImpl* tree_impl) { 44 LayerTreeImpl* tree_impl) {
45 if (!layer_root) 45 if (!layer_root)
46 tree_impl->ClearLayers(); 46 tree_impl->DetachLayers();
47 else 47 else
48 SynchronizeTreesInternal(layer_root, tree_impl); 48 SynchronizeTreesInternal(layer_root, tree_impl);
49 } 49 }
50 50
51 void TreeSynchronizer::SynchronizeTrees(LayerImpl* layer_root, 51 void TreeSynchronizer::SynchronizeTrees(LayerImpl* layer_root,
52 LayerTreeImpl* tree_impl) { 52 LayerTreeImpl* tree_impl) {
53 if (!layer_root) 53 if (!layer_root)
54 tree_impl->ClearLayers(); 54 tree_impl->DetachLayers();
55 else 55 else
56 SynchronizeTreesInternal(layer_root, tree_impl); 56 SynchronizeTreesInternal(layer_root, tree_impl);
57 } 57 }
58 58
59 template <typename LayerType> 59 template <typename LayerType>
60 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers, 60 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers,
61 LayerType* layer, 61 LayerType* layer,
62 LayerTreeImpl* tree_impl) { 62 LayerTreeImpl* tree_impl) {
63 if (!layer) 63 if (!layer)
64 return nullptr; 64 return nullptr;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 active_tree); 141 active_tree);
142 } 142 }
143 143
144 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree, 144 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree,
145 LayerTreeImpl* impl_tree) { 145 LayerTreeImpl* impl_tree) {
146 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), 146 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(),
147 impl_tree); 147 impl_tree);
148 } 148 }
149 149
150 } // namespace cc 150 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | cc/trees/tree_synchronizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698