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

Unified Diff: cc/trees/property_tree_builder.cc

Issue 2423483003: cc: Make visible rect computation aware of pixel-moving filters (Closed)
Patch Set: Rebaseline Created 4 years, 2 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
Index: cc/trees/property_tree_builder.cc
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index 9cb1636d13da98f8f8b2d69f5079e13c5c486912..f7a5ae292f8ccedece73181e8347f3b069dce414 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -225,6 +225,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();
}
@@ -429,10 +437,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 =
+ ClipExpander::CreateForFilter(layer->effect_tree_index());
+ } else {
node.clip_type = ClipNode::ClipType::NONE;
+ }
node.resets_clip = has_unclipped_surface;
node.target_is_clipped = data_for_children->target_is_clipped;
node.layers_are_clipped = layers_are_clipped;
@@ -800,10 +813,6 @@ static inline SkXfermode::Mode 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();
}
@@ -812,10 +821,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();
}

Powered by Google App Engine
This is Rietveld 408576698