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

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: ' 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
« cc/trees/layer_tree_impl.cc ('K') | « 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..a16033d71ab8341242dae60ad7f9d43364ee21db 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,15 +936,17 @@ 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);
data_for_children->axis_align_since_render_target &=
AnimationsPreserveAxisAlignment(layer);
- bool requires_node = is_root || has_transparency ||
- has_potential_opacity_animation ||
- should_create_render_surface;
+ bool requires_node =
+ is_root || has_transparency || has_potential_opacity_animation ||
+ has_potential_filter_animation || should_create_render_surface;
jaydasika 2016/07/20 20:53:06 Is this condition required ? Doesn't has_potential
ajuma 2016/07/21 16:42:18 Done. (It's surprising that has_potential_opacity_
jaydasika 2016/07/21 17:22:35 It sounds like a bug to me. For the case, current
ajuma 2016/07/21 18:49:41 Yeah, it's a bug. I'll fix it in a separate CL. I
int parent_id = data_from_ancestor.effect_tree_parent;
@@ -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);
weiliangc 2016/07/21 01:06:38 This would make a copy of the Filter owned by Laye
ajuma 2016/07/21 16:42:18 If we transfer ownership rather than copying, we'l
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)) {
« cc/trees/layer_tree_impl.cc ('K') | « cc/trees/occlusion_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698