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

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

Issue 2110683004: cc: Move filters to the effect tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 4 years, 5 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_impl.h ('k') | cc/trees/mutator_host_client.h » ('j') | 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/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
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 layer_ids_to_remove.push_back(id); 652 layer_ids_to_remove.push_back(id);
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);
662 layer_ids_to_remove.clear();
663
664 for (auto& layer_id_to_filters : filter_animations_map_) {
665 const int id = layer_id_to_filters.first;
666 if (property_trees_.IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id)) {
667 EffectNode* node = property_trees_.effect_tree.Node(
668 property_trees_.effect_id_to_index_map[id]);
669 if (!node->is_currently_animating_filter ||
670 node->filters == layer_id_to_filters.second) {
671 layer_ids_to_remove.push_back(id);
672 continue;
673 }
674 node->filters = layer_id_to_filters.second;
675 property_trees_.effect_tree.set_needs_update(true);
676 }
677 }
678 for (auto id : layer_ids_to_remove)
679 filter_animations_map_.erase(id);
657 680
658 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) { 681 LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) {
659 layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded(); 682 layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
660 }); 683 });
661 } 684 }
662 685
663 void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) { 686 void LayerTreeImpl::SetPageScaleOnActiveTree(float active_page_scale) {
664 DCHECK(IsActiveTree()); 687 DCHECK(IsActiveTree());
665 if (page_scale_factor()->SetCurrent( 688 if (page_scale_factor()->SetCurrent(
666 ClampPageScaleFactorToLimits(active_page_scale))) { 689 ClampPageScaleFactorToLimits(active_page_scale))) {
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2026 2049
2027 void LayerTreeImpl::ResetAllChangeTracking() { 2050 void LayerTreeImpl::ResetAllChangeTracking() {
2028 layers_that_should_push_properties_.clear(); 2051 layers_that_should_push_properties_.clear();
2029 // Iterate over all layers, including masks and replicas. 2052 // Iterate over all layers, including masks and replicas.
2030 for (auto& layer : *layers_) 2053 for (auto& layer : *layers_)
2031 layer->ResetChangeTracking(); 2054 layer->ResetChangeTracking();
2032 property_trees_.ResetAllChangeTracking(); 2055 property_trees_.ResetAllChangeTracking();
2033 } 2056 }
2034 2057
2035 } // namespace cc 2058 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | cc/trees/mutator_host_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698