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

Unified Diff: cc/trees/property_tree_builder.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/occlusion_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 6d9c2f20c70effbfdc49a256683c9e7e55980cfb..591be67c9c33c18d1e74ff29b68c9a9c04eb8cec 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -767,6 +767,14 @@ static inline float Opacity(LayerImpl* layer) {
return layer->test_properties()->opacity;
}
+static inline const FilterOperations& Filters(Layer* layer) {
+ return layer->filters();
+}
+
+static inline const FilterOperations& Filters(LayerImpl* layer) {
+ return layer->test_properties()->filters;
+}
+
static inline const FilterOperations& BackgroundFilters(Layer* layer) {
return layer->background_filters();
}
@@ -822,7 +830,7 @@ bool ShouldCreateRenderSurface(LayerType* layer,
}
// If the layer uses a CSS filter.
- if (!layer->filters().IsEmpty() || !BackgroundFilters(layer).IsEmpty()) {
+ if (!Filters(layer).IsEmpty() || !BackgroundFilters(layer).IsEmpty()) {
return true;
}
@@ -928,6 +936,8 @@ bool AddEffectNodeIfNeeded(
const bool has_transparency = EffectiveOpacity(layer) != 1.f;
const bool has_potential_opacity_animation =
HasPotentialOpacityAnimation(layer);
+ const bool has_potential_filter_animation =
+ HasPotentiallyRunningFilterAnimation(layer);
const bool should_create_render_surface = ShouldCreateRenderSurface(
layer, data_from_ancestor.compound_transform_since_render_target,
data_from_ancestor.axis_align_since_render_target);
@@ -958,11 +968,14 @@ bool AddEffectNodeIfNeeded(
node.opacity = Opacity(layer);
node.has_render_surface = should_create_render_surface;
node.has_copy_request = HasCopyRequest(layer);
+ node.filters = Filters(layer);
node.background_filters = BackgroundFilters(layer);
node.has_potential_opacity_animation = has_potential_opacity_animation;
+ node.has_potential_filter_animation = has_potential_filter_animation;
node.double_sided = DoubleSided(layer);
node.subtree_hidden = HideLayerAndSubtree(layer);
node.is_currently_animating_opacity = OpacityIsAnimating(layer);
+ node.is_currently_animating_filter = FilterIsAnimating(layer);
EffectTree& effect_tree = data_for_children->property_trees->effect_tree;
if (MaskLayer(layer)) {
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698