kas-gui / kas

Another GUI toolkit
Apache License 2.0
893 stars 27 forks source link

Async rendering for Svg widget #378

Closed dhardy closed 1 year ago

dhardy commented 1 year ago

Follow up on #376 adding async rendering for Svg.

Since the usvg::Tree type is neither Sync nor Send (see https://github.com/RazrFalcon/resvg/issues/544), this re-parses the data each time the SVG is rendered (much faster than the render itself). The main drawback is that now we must retain access to the data somehow: here either by using a &'static [u8] or an Arc<[u8]>.