Index: cc/trees/property_tree_builder.cc |
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc |
index 23ce510aaf89537c18df9f1258d78a1784d4f521..f66fcda90e52146e4886f811b9225547aee64cf8 100644 |
--- a/cc/trees/property_tree_builder.cc |
+++ b/cc/trees/property_tree_builder.cc |
@@ -9,6 +9,7 @@ |
#include <map> |
#include <set> |
+#include "base/memory/ptr_util.h" |
#include "cc/base/math_util.h" |
#include "cc/layers/layer.h" |
#include "cc/layers/layer_impl.h" |
@@ -225,6 +226,14 @@ static size_t NumUnclippedDescendants(LayerImpl* layer) { |
return layer->test_properties()->num_unclipped_descendants; |
} |
+static inline const FilterOperations& Filters(Layer* layer) { |
+ return layer->filters(); |
+} |
+ |
+static inline const FilterOperations& Filters(LayerImpl* layer) { |
+ return layer->test_properties()->filters; |
+} |
+ |
static Layer* MaskLayer(Layer* layer) { |
return layer->mask_layer(); |
} |
@@ -437,10 +446,15 @@ void AddClipNodeIfNeeded(const DataForRecursion<LayerType>& data_from_ancestor, |
node.layer_clipping_uses_only_local_clip = false; |
} |
- if (layer_clips_subtree) |
+ if (layer_clips_subtree) { |
node.clip_type = ClipNode::ClipType::APPLIES_LOCAL_CLIP; |
- else |
+ } else if (Filters(layer).HasFilterThatMovesPixels()) { |
+ node.clip_type = ClipNode::ClipType::EXPANDS_CLIP; |
+ node.clip_expander = |
+ base::MakeUnique<ClipExpander>(layer->effect_tree_index()); |
+ } else { |
node.clip_type = ClipNode::ClipType::NONE; |
+ } |
node.resets_clip = has_unclipped_surface; |
node.layers_are_clipped = layers_are_clipped; |
node.layers_are_clipped_when_surfaces_disabled = |
@@ -834,10 +848,6 @@ static inline SkBlendMode BlendMode(LayerImpl* layer) { |
return layer->test_properties()->blend_mode; |
} |
-static inline const FilterOperations& Filters(Layer* layer) { |
- return layer->filters(); |
-} |
- |
static inline const gfx::PointF FiltersOrigin(Layer* layer) { |
return layer->filters_origin(); |
} |
@@ -846,10 +856,6 @@ static inline const gfx::PointF FiltersOrigin(LayerImpl* layer) { |
return layer->test_properties()->filters_origin; |
} |
-static inline const FilterOperations& Filters(LayerImpl* layer) { |
- return layer->test_properties()->filters; |
-} |
- |
static inline const FilterOperations& BackgroundFilters(Layer* layer) { |
return layer->background_filters(); |
} |