Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit cf4a1d9

Browse files
committed
render ImageFilterLayer children with transformed filter
1 parent 84db8ba commit cf4a1d9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

flow/layers/image_filter_layer.cc

+10-6
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,22 @@ void ImageFilterLayer::Paint(PaintContext& context) const {
112112
}
113113
}
114114

115-
// Now apply the image filter and then try rendering children either from
116-
// cache or directly.
117-
mutator.applyImageFilter(child_paint_bounds(), filter_);
118-
119115
if (context.raster_cache && layer_raster_cache_item_->IsCacheChildren()) {
116+
// If we render the children from cache then we need the special
117+
// transformed version of the filter so we must process it into the
118+
// cache paint object manually.
119+
FML_DCHECK(transformed_filter_ != nullptr);
120120
SkPaint sk_paint;
121-
if (layer_raster_cache_item_->Draw(context,
122-
context.state_stack.fill(sk_paint))) {
121+
context.state_stack.fill(sk_paint);
122+
sk_paint.setImageFilter(transformed_filter_->skia_object());
123+
if (layer_raster_cache_item_->Draw(context, &sk_paint)) {
123124
return;
124125
}
125126
}
126127

128+
// Now apply the image filter and then try rendering the children.
129+
mutator.applyImageFilter(child_paint_bounds(), filter_);
130+
127131
PaintChildren(context);
128132
}
129133

0 commit comments

Comments
 (0)