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

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

Issue 2080703005: cc: Remove LayerTreeImpl::root_layer usage outside tests (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/tree_synchronizer.h ('k') | no next file » | 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->DetachLayers(); 46 tree_impl->DetachLayers();
47 } else { 47 } else {
48 SynchronizeTreesInternal(layer_root->layer_tree_host(), tree_impl, 48 SynchronizeTreesInternal(layer_root->layer_tree_host(), tree_impl,
49 layer_root->layer_tree_host()->property_trees()); 49 layer_root->layer_tree_host()->property_trees());
50 } 50 }
51 } 51 }
52 52
53 void TreeSynchronizer::SynchronizeTrees(LayerImpl* layer_root, 53 void TreeSynchronizer::SynchronizeTrees(LayerTreeImpl* pending_tree,
54 LayerTreeImpl* tree_impl) { 54 LayerTreeImpl* active_tree) {
55 if (!layer_root) { 55 if (pending_tree->LayerListIsEmpty()) {
56 tree_impl->DetachLayers(); 56 active_tree->DetachLayers();
57 } else { 57 } else {
58 SynchronizeTreesInternal(layer_root->layer_tree_impl(), tree_impl, 58 SynchronizeTreesInternal(pending_tree, active_tree,
59 layer_root->layer_tree_impl()->property_trees()); 59 pending_tree->property_trees());
60 } 60 }
61 } 61 }
62 62
63 template <typename LayerType> 63 template <typename LayerType>
64 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers, 64 std::unique_ptr<LayerImpl> ReuseOrCreateLayerImpl(OwnedLayerImplMap* old_layers,
65 LayerType* layer, 65 LayerType* layer,
66 LayerTreeImpl* tree_impl) { 66 LayerTreeImpl* tree_impl) {
67 if (!layer) 67 if (!layer)
68 return nullptr; 68 return nullptr;
69 std::unique_ptr<LayerImpl> layer_impl = std::move((*old_layers)[layer->id()]); 69 std::unique_ptr<LayerImpl> layer_impl = std::move((*old_layers)[layer->id()]);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 active_tree); 104 active_tree);
105 } 105 }
106 106
107 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree, 107 void TreeSynchronizer::PushLayerProperties(LayerTreeHost* host_tree,
108 LayerTreeImpl* impl_tree) { 108 LayerTreeImpl* impl_tree) {
109 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(), 109 PushLayerPropertiesInternal(host_tree->LayersThatShouldPushProperties(),
110 impl_tree); 110 impl_tree);
111 } 111 }
112 112
113 } // namespace cc 113 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/tree_synchronizer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698