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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
541 | 541 |
542 void LayerTreeImpl::AddToOpacityAnimationsMap(int id, float opacity) { | 542 void LayerTreeImpl::AddToOpacityAnimationsMap(int id, float opacity) { |
543 opacity_animations_map_[id] = opacity; | 543 opacity_animations_map_[id] = opacity; |
544 } | 544 } |
545 | 545 |
546 void LayerTreeImpl::AddToTransformAnimationsMap(int id, | 546 void LayerTreeImpl::AddToTransformAnimationsMap(int id, |
547 gfx::Transform transform) { | 547 gfx::Transform transform) { |
548 transform_animations_map_[id] = transform; | 548 transform_animations_map_[id] = transform; |
549 } | 549 } |
550 | 550 |
551 void LayerTreeImpl::AddToFilterAnimationsMap(int id, | |
552 const FilterOperations& filters) { | |
553 filter_animations_map_[id] = filters; | |
554 } | |
555 | |
551 LayerImpl* LayerTreeImpl::InnerViewportContainerLayer() const { | 556 LayerImpl* LayerTreeImpl::InnerViewportContainerLayer() const { |
552 return InnerViewportScrollLayer() | 557 return InnerViewportScrollLayer() |
553 ? InnerViewportScrollLayer()->scroll_clip_layer() | 558 ? InnerViewportScrollLayer()->scroll_clip_layer() |
554 : NULL; | 559 : NULL; |
555 } | 560 } |
556 | 561 |
557 LayerImpl* LayerTreeImpl::OuterViewportContainerLayer() const { | 562 LayerImpl* LayerTreeImpl::OuterViewportContainerLayer() const { |
558 return OuterViewportScrollLayer() | 563 return OuterViewportScrollLayer() |
559 ? OuterViewportScrollLayer()->scroll_clip_layer() | 564 ? OuterViewportScrollLayer()->scroll_clip_layer() |
560 : NULL; | 565 : NULL; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
648 continue; | 653 continue; |
649 } | 654 } |
650 node->local = layer_id_to_transform.second; | 655 node->local = layer_id_to_transform.second; |
651 node->needs_local_transform_update = true; | 656 node->needs_local_transform_update = true; |
652 property_trees_.transform_tree.set_needs_update(true); | 657 property_trees_.transform_tree.set_needs_update(true); |
653 } | 658 } |
654 } | 659 } |
655 for (auto id : layer_ids_to_remove) | 660 for (auto id : layer_ids_to_remove) |
656 transform_animations_map_.erase(id); | 661 transform_animations_map_.erase(id); |
657 | 662 |
663 for (auto& layer_id_to_filters : filter_animations_map_) { | |
664 const int id = layer_id_to_filters.first; | |
665 if (property_trees_.IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id)) { | |
666 EffectNode* node = property_trees_.effect_tree.Node( | |
667 property_trees_.effect_id_to_index_map[id]); | |
668 if (!node->is_currently_animating_filter || | |
669 node->filters == layer_id_to_filters.second) | |
jaydasika
2016/07/20 20:53:06
Only elements that satisfy this if condition shoul
ajuma
2016/07/21 16:42:18
Done.
| |
670 continue; | |
671 node->filters = layer_id_to_filters.second; | |
672 property_trees_.effect_tree.set_needs_update(true); | |
673 } | |
674 } | |
675 | |
676 filter_animations_map_.clear(); | |
658 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) { | 677 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) { |
659 layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); | 678 layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); |
660 }); | 679 }); |
661 } | 680 } |
662 | 681 |
663 void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) { | 682 void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) { |
664 DCHECK(IsActiveTree()); | 683 DCHECK(IsActiveTree()); |
665 if (page_scale_factor()->SetCurrent( | 684 if (page_scale_factor()->SetCurrent( |
666 ClampPageScaleFactorToLimits(active_page_scale))) { | 685 ClampPageScaleFactorToLimits(active_page_scale))) { |
667 DidUpdatePageScale(); | 686 DidUpdatePageScale(); |
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2026 | 2045 |
2027 void LayerTreeImpl::ResetAllChangeTracking() { | 2046 void LayerTreeImpl::ResetAllChangeTracking() { |
2028 layers_that_should_push_properties_.clear(); | 2047 layers_that_should_push_properties_.clear(); |
2029 // Iterate over all layers, including masks and replicas. | 2048 // Iterate over all layers, including masks and replicas. |
2030 for (auto& layer : *layers_) | 2049 for (auto& layer : *layers_) |
2031 layer->ResetChangeTracking(); | 2050 layer->ResetChangeTracking(); |
2032 property_trees_.ResetAllChangeTracking(); | 2051 property_trees_.ResetAllChangeTracking(); |
2033 } | 2052 } |
2034 | 2053 |
2035 } // namespace cc | 2054 } // namespace cc |
OLD | NEW |