| 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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 layers.scroll = nullptr; | 481 layers.scroll = nullptr; |
| 482 | 482 |
| 483 if (!layers.main && !layers.scroll) | 483 if (!layers.main && !layers.scroll) |
| 484 element_layers_map_.erase(layer->element_id()); | 484 element_layers_map_.erase(layer->element_id()); |
| 485 } | 485 } |
| 486 | 486 |
| 487 void LayerTreeImpl::AddToOpacityAnimationsMap(int id, float opacity) { | 487 void LayerTreeImpl::AddToOpacityAnimationsMap(int id, float opacity) { |
| 488 opacity_animations_map_[id] = opacity; | 488 opacity_animations_map_[id] = opacity; |
| 489 } | 489 } |
| 490 | 490 |
| 491 void LayerTreeImpl::UpdateLayerToPropertyTreeIndicesMap( |
| 492 int id, |
| 493 int tree_index, |
| 494 PropertyTrees::Types tree_type) { |
| 495 PropertyTreeIndices& indices = layer_to_property_tree_indices_map_[id]; |
| 496 switch (tree_type) { |
| 497 case PropertyTrees::Types::TRANSFORM_TREE: |
| 498 indices.transform_tree_index = tree_index; |
| 499 break; |
| 500 case PropertyTrees::Types::CLIP_TREE: |
| 501 indices.clip_tree_index = tree_index; |
| 502 break; |
| 503 case PropertyTrees::Types::SCROLL_TREE: |
| 504 indices.scroll_tree_index = tree_index; |
| 505 break; |
| 506 case PropertyTrees::Types::EFFECT_TREE: |
| 507 indices.effect_tree_index = tree_index; |
| 508 break; |
| 509 default: |
| 510 break; |
| 511 } |
| 512 } |
| 513 |
| 514 void LayerTreeImpl::RemoveFromLayerToPropertyTreeIndicesMap(int id) { |
| 515 layer_to_property_tree_indices_map_.erase(id); |
| 516 } |
| 517 |
| 491 LayerTreeImpl::ElementLayers LayerTreeImpl::GetMutableLayers( | 518 LayerTreeImpl::ElementLayers LayerTreeImpl::GetMutableLayers( |
| 492 uint64_t element_id) { | 519 uint64_t element_id) { |
| 493 auto iter = element_layers_map_.find(element_id); | 520 auto iter = element_layers_map_.find(element_id); |
| 494 if (iter == element_layers_map_.end()) | 521 if (iter == element_layers_map_.end()) |
| 495 return ElementLayers(); | 522 return ElementLayers(); |
| 496 | 523 |
| 497 return iter->second; | 524 return iter->second; |
| 498 } | 525 } |
| 499 | 526 |
| 500 LayerImpl* LayerTreeImpl::InnerViewportContainerLayer() const { | 527 LayerImpl* LayerTreeImpl::InnerViewportContainerLayer() const { |
| (...skipping 1596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2097 *bounds = gfx::BoxF(); | 2124 *bounds = gfx::BoxF(); |
| 2098 return layer_tree_host_impl_->animation_host() | 2125 return layer_tree_host_impl_->animation_host() |
| 2099 ->TransformAnimationBoundsForBox(layer->id(), box, bounds); | 2126 ->TransformAnimationBoundsForBox(layer->id(), box, bounds); |
| 2100 } | 2127 } |
| 2101 | 2128 |
| 2102 void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) { | 2129 void LayerTreeImpl::ScrollAnimationAbort(bool needs_completion) { |
| 2103 layer_tree_host_impl_->animation_host()->ScrollAnimationAbort( | 2130 layer_tree_host_impl_->animation_host()->ScrollAnimationAbort( |
| 2104 needs_completion); | 2131 needs_completion); |
| 2105 } | 2132 } |
| 2106 | 2133 |
| 2107 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::ResetFlags flag) { | 2134 void LayerTreeImpl::ResetAllChangeTracking(PropertyTrees::Types type) { |
| 2108 layers_that_should_push_properties_.clear(); | 2135 layers_that_should_push_properties_.clear(); |
| 2109 for (auto* layer : *this) | 2136 for (auto* layer : *this) |
| 2110 layer->ResetChangeTracking(); | 2137 layer->ResetChangeTracking(); |
| 2111 property_trees_.ResetAllChangeTracking(flag); | 2138 property_trees_.ResetAllChangeTracking(type); |
| 2112 } | 2139 } |
| 2113 | 2140 |
| 2114 } // namespace cc | 2141 } // namespace cc |
| OLD | NEW |