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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 4951dd55fee114c11752da3916eac81c87f8fe94..87a318a62815610a4caea71e9ef69ae5652178af 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -548,6 +548,11 @@ void LayerTreeImpl::AddToTransformAnimationsMap(int id,
transform_animations_map_[id] = transform;
}
+void LayerTreeImpl::AddToFilterAnimationsMap(int id,
+ const FilterOperations& filters) {
+ filter_animations_map_[id] = filters;
+}
+
LayerImpl* LayerTreeImpl::InnerViewportContainerLayer() const {
return InnerViewportScrollLayer()
? InnerViewportScrollLayer()->scroll_clip_layer()
@@ -654,6 +659,24 @@ void LayerTreeImpl::UpdatePropertyTreeScrollingAndAnimationFromMainThread() {
}
for (auto id : layer_ids_to_remove)
transform_animations_map_.erase(id);
+ layer_ids_to_remove.clear();
+
+ for (auto& layer_id_to_filters : filter_animations_map_) {
+ const int id = layer_id_to_filters.first;
+ if (property_trees_.IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id)) {
+ EffectNode* node = property_trees_.effect_tree.Node(
+ property_trees_.effect_id_to_index_map[id]);
+ if (!node->is_currently_animating_filter ||
+ node->filters == layer_id_to_filters.second) {
+ layer_ids_to_remove.push_back(id);
+ continue;
+ }
+ node->filters = layer_id_to_filters.second;
+ property_trees_.effect_tree.set_needs_update(true);
+ }
+ }
+ for (auto id : layer_ids_to_remove)
+ filter_animations_map_.erase(id);
LayerTreeHostCommon::CallFunctionForEveryLayer(this, [](LayerImpl* layer) {
layer->UpdatePropertyTreeForScrollingAndAnimationIfNeeded();
« 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