mcpiroman
05/05/2022, 9:41 AMModifier.graphicsLayer()
, every recomposition causes whole screen/everything to redraw, even when not everything is recomposed?Igor Demin
05/06/2022, 5:28 PMgraphicsLayer
on desktop just caches drawing operations, not the whole buffer with prerendered pixels. It can someway increase performance, but not significantly. In the future implementation can change, and layers can be cached fully (not only operations, but the whole rendered pixels). It will definitely increase performance (but also increase memory consumption). This will be investigated as part of this issue.mcpiroman
05/07/2022, 8:41 AMIgor Demin
05/07/2022, 9:42 AMinsets in Compose.I am not sure which insets you mentioned, by usually insets has nothing to do with redrawing optimisation.
I assume much gradualness can be achieved even without cached bitmaps (at least when there are not many overlaps and transparency).Yes, it is one of the options - not to cache into bitmap, but only redraw a part of the screen. For this optimisation, even explicit
graphicsLayer
probably won’t be needed (I just checked, and Compose creates a separate layer per Box
).
is only a window (re)painted, or a whole content?If we have multiple windows, only the changed window will be repainted.
mcpiroman
05/07/2022, 7:32 PMIgor Demin
05/07/2022, 9:04 PME.g. if I have a list of a few hundred elements, I feel like all of them are (re)painted, not only those currently visible.Only visible content repainted