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

Commit 9094ab0

Browse files
committed
render ImageFilterLayer children with transformed filter
1 parent 862dab6 commit 9094ab0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

flow/layers/image_filter_layer.cc

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,18 +109,22 @@ void ImageFilterLayer::Paint(PaintContext& context) const {
109109
}
110110
}
111111

112-
// Now apply the image filter and then try rendering children either from
113-
// cache or directly.
114-
mutator.applyImageFilter(child_paint_bounds(), filter_);
115-
116112
if (context.raster_cache && layer_raster_cache_item_->IsCacheChildren()) {
113+
// If we render the children from cache then we need the special
114+
// transformed version of the filter so we must process it into the
115+
// cache paint object manually.
116+
FML_DCHECK(transformed_filter_ != nullptr);
117117
SkPaint sk_paint;
118-
if (layer_raster_cache_item_->Draw(context,
119-
context.state_stack.fill(sk_paint))) {
118+
context.state_stack.fill(sk_paint);
119+
sk_paint.setImageFilter(transformed_filter_->skia_object());
120+
if (layer_raster_cache_item_->Draw(context, &sk_paint)) {
120121
return;
121122
}
122123
}
123124

125+
// Now apply the image filter and then try rendering the children.
126+
mutator.applyImageFilter(child_paint_bounds(), filter_);
127+
124128
PaintChildren(context);
125129
}
126130

0 commit comments

Comments
 (0)