4 ms·
> but based on what I've seen you never want to render to texture (which Flutter does sometimes) Flutter's "layers" are rasterized to texture if they are uncha
by kllrnohj 8y ago
> but based on what I've seen you never want to render to texture (which Flutter does sometimes)
Flutter's "layers" are rasterized to texture if they are unchanged for N frames (I think N = 3?). Which happens kind of a lot, and is (one of) the reasons Flutter has such a big RAM footprint. Flutter's layers remind me a lot of the hacky, terrible will-change CSS property.
Other than that it's just a rather crude way to hack up the rendering commands into smaller display lists. Android has been doing this for ages with RenderNode with both display lists & transform properties on those display lists.
- nine_k 8y agoDoesn't macOS do a similar thing?
- pcwalton 8y agoWell, in macOS (and Windows) the layers are explicitly created by the programmer: they aren't implicitly created based on heuristics. That's a significant difference. The Web has historically followed Flutter here in having a complex set of "layerization" heuristics. One of the main motivations of WebRender is to change that.
- raphlinus 8y agoPatrick is of course right here, macOS isn't quite like Flutter because it basically always texturizes, although ultimately this is under control of the programmers. And perhaps it would be more accurate to say Flutter follows the Web, as many of the team are former Chrome engineers, though I think they've tried to clean up a lot of the warty stuff. And absolutely, the idea of relying less on the compositor is not original to me, WebRender has similar goals, though I think I can make things performant, rich, and fairly simple by leveraging compute.
- kvark 8y agoIronically, with picture caching WebRender converges to the very same heuristics that drive Flutter layerization...
- raphlinus 8y agoYes, macOS relies very heavily on CALayer to accomplish smooth scrolling, largely because much of the content of those layers is software-rendered. One thing that I find interesting is the subtle effect this has on the aesthetics of macOS (and iOS also) - lots of semitransparent planes sliding over each other and fading, very few other things that would be expensive in that model. I think this is a bad approach on modern hardware, for the reasons kllrnohj stated.