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

Unified Diff: cc/layers/layer_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/layers/layer_impl.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.cc
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 15a494920474e404041001fc91fbb2139d4023fe..ac53860f007bef5b7daec8be0b7b2eaa334e9031 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -349,7 +349,6 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) {
layer->effect_tree_index_ = effect_tree_index_;
layer->clip_tree_index_ = clip_tree_index_;
layer->scroll_tree_index_ = scroll_tree_index_;
- layer->filters_ = filters_;
layer->sorting_context_id_ = sorting_context_id_;
layer->has_will_change_transform_hint_ = has_will_change_transform_hint_;
@@ -596,18 +595,19 @@ gfx::ScrollOffset LayerImpl::ScrollOffsetForAnimation() const {
}
void LayerImpl::OnFilterAnimated(const FilterOperations& filters) {
- if (filters_ != filters) {
- SetFilters(filters);
- SetNeedsPushProperties();
- layer_tree_impl()->set_needs_update_draw_properties();
- EffectTree& effect_tree = layer_tree_impl()->property_trees()->effect_tree;
- EffectNode* node = effect_tree.Node(effect_tree_index_);
- DCHECK(layer_tree_impl()->property_trees()->IsInIdToIndexMap(
- PropertyTrees::TreeType::EFFECT, id()));
- node->effect_changed = true;
- layer_tree_impl()->property_trees()->changed = true;
- effect_tree.set_needs_update(true);
- }
+ layer_tree_impl()->AddToFilterAnimationsMap(id(), filters);
+ PropertyTrees* property_trees = layer_tree_impl()->property_trees();
+ DCHECK(
+ property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id()));
+ EffectNode* node = property_trees->effect_tree.Node(effect_tree_index());
+ if (node->filters == filters)
+ return;
+ node->filters = filters;
+ node->effect_changed = true;
+ property_trees->changed = true;
+ property_trees->effect_tree.set_needs_update(true);
+ SetNeedsPushProperties();
+ layer_tree_impl()->set_needs_update_draw_properties();
}
void LayerImpl::OnOpacityAnimated(float opacity) {
@@ -683,6 +683,29 @@ void LayerImpl::OnOpacityIsPotentiallyAnimatingChanged(
property_trees->effect_tree.set_needs_update(true);
}
+void LayerImpl::OnFilterIsCurrentlyAnimatingChanged(
+ bool is_currently_animating) {
+ DCHECK(layer_tree_impl_);
+ PropertyTrees* property_trees = layer_tree_impl()->property_trees();
+ if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id()))
+ return;
+ EffectNode* node = property_trees->effect_tree.Node(
+ property_trees->effect_id_to_index_map[id()]);
+
+ node->is_currently_animating_filter = is_currently_animating;
+}
+
+void LayerImpl::OnFilterIsPotentiallyAnimatingChanged(
+ bool has_potential_animation) {
+ DCHECK(layer_tree_impl_);
+ PropertyTrees* property_trees = layer_tree_impl()->property_trees();
+ if (!property_trees->IsInIdToIndexMap(PropertyTrees::TreeType::EFFECT, id()))
+ return;
+ EffectNode* node = property_trees->effect_tree.Node(
+ property_trees->effect_id_to_index_map[id()]);
+ node->has_potential_filter_animation = has_potential_animation;
+}
+
bool LayerImpl::IsActive() const {
return layer_tree_impl_->IsActiveTree();
}
@@ -776,10 +799,6 @@ SkColor LayerImpl::SafeOpaqueBackgroundColor() const {
return color;
}
-void LayerImpl::SetFilters(const FilterOperations& filters) {
- filters_ = filters;
-}
-
bool LayerImpl::FilterIsAnimating() const {
return GetAnimationHost()->IsAnimatingFilterProperty(
element_id(), GetElementTypeForAnimation());
« no previous file with comments | « cc/layers/layer_impl.h ('k') | cc/layers/layer_impl_test_properties.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698