Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 if (layer_tree_host_ == host) | 128 if (layer_tree_host_ == host) |
| 129 return; | 129 return; |
| 130 | 130 |
| 131 if (layer_tree_host_) { | 131 if (layer_tree_host_) { |
| 132 layer_tree_host_->property_trees()->needs_rebuild = true; | 132 layer_tree_host_->property_trees()->needs_rebuild = true; |
| 133 layer_tree_host_->UnregisterLayer(this); | 133 layer_tree_host_->UnregisterLayer(this); |
| 134 } | 134 } |
| 135 if (host) { | 135 if (host) { |
| 136 host->property_trees()->needs_rebuild = true; | 136 host->property_trees()->needs_rebuild = true; |
| 137 host->RegisterLayer(this); | 137 host->RegisterLayer(this); |
| 138 DCHECK(!host->in_update()); | |
|
enne (OOO)
2015/07/10 20:29:21
Reuse host->in_paint_layer_contents()?
ajuma
2015/07/10 20:52:53
Done, and moved the DCHECK over to LayerTreeHost::
| |
| 138 } | 139 } |
| 139 | 140 |
| 140 InvalidatePropertyTreesIndices(); | 141 InvalidatePropertyTreesIndices(); |
| 141 | 142 |
| 142 layer_tree_host_ = host; | 143 layer_tree_host_ = host; |
| 143 | 144 |
| 144 // When changing hosts, the layer needs to commit its properties to the impl | 145 // When changing hosts, the layer needs to commit its properties to the impl |
| 145 // side for the new host. | 146 // side for the new host. |
| 146 SetNeedsPushProperties(); | 147 SetNeedsPushProperties(); |
| 147 | 148 |
| (...skipping 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1659 ? layer_tree_host()->meta_information_sequence_number() | 1660 ? layer_tree_host()->meta_information_sequence_number() |
| 1660 : 0; | 1661 : 0; |
| 1661 } | 1662 } |
| 1662 | 1663 |
| 1663 bool Layer::sorted_for_recursion() { | 1664 bool Layer::sorted_for_recursion() { |
| 1664 return sorted_for_recursion_tracker_ == | 1665 return sorted_for_recursion_tracker_ == |
| 1665 layer_tree_host()->meta_information_sequence_number(); | 1666 layer_tree_host()->meta_information_sequence_number(); |
| 1666 } | 1667 } |
| 1667 | 1668 |
| 1668 } // namespace cc | 1669 } // namespace cc |
| OLD | NEW |