| OLD | NEW |
| 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_impl.h" | 5 #include "cc/trees/layer_tree_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 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 547 return; | 547 return; |
| 548 | 548 |
| 549 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), | 549 TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("compositor-worker"), |
| 550 "LayerTreeImpl::AddToElementMap", "element", | 550 "LayerTreeImpl::AddToElementMap", "element", |
| 551 element_id.AsValue().release(), "layer_id", layer->id()); | 551 element_id.AsValue().release(), "layer_id", layer->id()); |
| 552 | 552 |
| 553 #if DCHECK_IS_ON() | 553 #if DCHECK_IS_ON() |
| 554 LayerImpl* existing_layer = LayerByElementId(element_id); | 554 LayerImpl* existing_layer = LayerByElementId(element_id); |
| 555 bool element_id_collision_detected = | 555 bool element_id_collision_detected = |
| 556 existing_layer && existing_layer != layer; | 556 existing_layer && existing_layer != layer; |
| 557 DCHECK(!element_id_collision_detected); | 557 |
| 558 // TODO(pdr): Remove this suppression and always check for id collisions. |
| 559 // This is a temporary suppression for SPV2 which generates unnecessary |
| 560 // layers that collide. Remove once crbug.com/693693 is fixed. |
| 561 if (!settings().use_layer_lists) |
| 562 DCHECK(!element_id_collision_detected); |
| 558 #endif | 563 #endif |
| 559 | 564 |
| 560 element_layers_map_[element_id] = layer->id(); | 565 element_layers_map_[element_id] = layer->id(); |
| 561 | 566 |
| 562 layer_tree_host_impl_->mutator_host()->RegisterElement( | 567 layer_tree_host_impl_->mutator_host()->RegisterElement( |
| 563 element_id, | 568 element_id, |
| 564 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING); | 569 IsActiveTree() ? ElementListType::ACTIVE : ElementListType::PENDING); |
| 565 } | 570 } |
| 566 | 571 |
| 567 void LayerTreeImpl::RemoveFromElementMap(LayerImpl* layer) { | 572 void LayerTreeImpl::RemoveFromElementMap(LayerImpl* layer) { |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2092 | 2097 |
| 2093 void LayerTreeImpl::ResetAllChangeTracking() { | 2098 void LayerTreeImpl::ResetAllChangeTracking() { |
| 2094 layers_that_should_push_properties_.clear(); | 2099 layers_that_should_push_properties_.clear(); |
| 2095 // Iterate over all layers, including masks. | 2100 // Iterate over all layers, including masks. |
| 2096 for (auto& layer : *layers_) | 2101 for (auto& layer : *layers_) |
| 2097 layer->ResetChangeTracking(); | 2102 layer->ResetChangeTracking(); |
| 2098 property_trees_.ResetAllChangeTracking(); | 2103 property_trees_.ResetAllChangeTracking(); |
| 2099 } | 2104 } |
| 2100 | 2105 |
| 2101 } // namespace cc | 2106 } // namespace cc |
| OLD | NEW |