-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
There are a number of issues related to the ImageFiltered widget and the ImageFilter.blur type of filter that arise due to confusion over how the edges are handled. One such issue deals with distortions where the pixels near the edges of a shape being blurred bleed outward in the horizontal and vertical directions. These distortions arise due to the fact that the blur filter uses a Skia kClamp (equivalent to Flutter's ui.TileMode.clamp) mode. If the child is a shape that brushes against the edges in a few places then those edge pixels will be non-transparent and the blur will carry their samples out to the edge of the resulting image.
We can give developers some control over this with 2 additions:
- Add TileMode as a property to ImageFilter.blur
- Add decal as a value to the TileMode enum
Note that the new value will also enable a new gradient type where the stops are shown from 0.0->1.0, but transparency is rendered everywhere else. Skia supports this mode, so it is new functionality that we haven't exposed. It may not be very useful for many cases of gradients, but the decal mode will be very useful for blurs. Similarly the repeat and mirror values may not be useful for many cases of blur, but they are supported for blurs even though they are primarily targeted at gradients.
The documentation for TileMode should be updated to explain its application in ImageFilter cases.