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

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

Issue 1850453002: cc : Fix bug in tree synchronization when mask layer changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 8 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_unittest.cc ('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 15 matching lines...) Expand all
26 scoped_ptr<OwnedLayerImplList> old_layers(tree_impl->DetachLayers()); 26 scoped_ptr<OwnedLayerImplList> old_layers(tree_impl->DetachLayers());
27 27
28 OwnedLayerImplMap old_layer_map; 28 OwnedLayerImplMap old_layer_map;
29 for (auto& it : *old_layers) 29 for (auto& it : *old_layers)
30 old_layer_map[it->id()] = std::move(it); 30 old_layer_map[it->id()] = std::move(it);
31 31
32 SynchronizeTreesRecursive(&old_layer_map, layer_root, tree_impl); 32 SynchronizeTreesRecursive(&old_layer_map, layer_root, tree_impl);
33 33
34 for (auto& it : old_layer_map) { 34 for (auto& it : old_layer_map) {
35 if (it.second) { 35 if (it.second) {
36 // Need to ensure that layer destruction doesn't tear down child 36 // Need to ensure that layer destruction doesn't tear down other layers
37 // 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->children().clear(); 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->ClearLayers();
47 else 47 else
48 SynchronizeTreesInternal(layer_root, tree_impl); 48 SynchronizeTreesInternal(layer_root, tree_impl);
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 impl_tree); 199 impl_tree);
200 200
201 #if DCHECK_IS_ON() 201 #if DCHECK_IS_ON()
202 if (host_tree->root_layer() && impl_tree->root_layer()) 202 if (host_tree->root_layer() && impl_tree->root_layer())
203 CheckScrollAndClipPointersRecursive(host_tree->root_layer(), 203 CheckScrollAndClipPointersRecursive(host_tree->root_layer(),
204 impl_tree->root_layer()); 204 impl_tree->root_layer());
205 #endif 205 #endif
206 } 206 }
207 207
208 } // namespace cc 208 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698