Flutter has a UI component `BackdropFilter` that l...
# compose
z
Flutter has a UI component
BackdropFilter
that lets you do stuff like blur whatever’s behind a view. I know that effect isn’t part of the Material spec, but is something like that possible (or potentially possible in the future) with Compose?
l
i think you could build this with public API today
could be wrong though
z
I haven’t seen anything in the API that looked obvious, but i might be thinking about it wrong
l
i think if you used Draw (and in the future, the draw modifier), you get raw access to the canvas and i think you could apply a filter there
z
The flutter implementation has a bunch of components that manipulate “layers” (presumably hardware layers?).
Draw(Modifier)
only give you access to your own children, not the layer below you, I think? https://github.com/flutter/flutter/blob/2132a0c7a3d2a107190238ca0c5570baa0467bb7/packages/flutter/lib/src/rendering/proxy_box.dart#L1064-L1073
Maybe i missed something in the canvas API
l
this might be relevant to some of the rendernode work we are doing
c
Android canvas doesn't really expose any blurring, other than BlurMaskFilter, which isn't supported for most operations
At least on most versions of the platform, not sure about recent ones
z
Yea, I was playing with BlurMaskFilter but it only lets you blur the current layer. I was wondering if this would require explicit RenderNode support.
r
BlurMaskFilter also doesn’t blur the content
z
Yea, it just fades the alpha along the edges
r
Well it blurs alpha :)