iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

`canvas::Cache` Grouping #2415

Closed hecrj closed 2 weeks ago

hecrj commented 2 weeks ago

This PR introduces a new constructor for canvas::Cache called with_group. This method can be used to group the caches of a canvas (or even different ones!) together in an application.

Cache groups serve as a hint that certain sets of primitives are likely to change together; enabling different kinds of optimizations in a renderer. For now, cache groups share the same text atlas when using iced_wgpu.