mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 15:45:38 +00:00
b183774063
When building GPU vertices from paths, we call stroke.SplitCubic once per OpCubic. Before this change, each call to stroke.SplitCubic would allocate a slice, which we would only use to iterate over. This allocation can be easily avoided by reusing the slice. We can conveniently store it in gpu.quadSplitter. In a real application that renders hundreds of paths with tens of rounded rectangles per path, this saved roughly 4500 allocations (or 1 MB worth) per frame. Signed-off-by: Dominik Honnef <dominik@honnef.co>