iris: move text state into shared resources

This commit is contained in:
iris committed 2026-09-12 14:18:12 -04:00
1 parent 7c23c5f146
commit 51719ed121
17 files changed
+631 -434

No files matched your search

+5 -6
View File
@@ -21,9 +21,10 @@ exists only to give a row enough text to wrap across several lines at a \
typical phone column width.";
fn build_row(rsc: &mut BenchRsc, i: usize, image_every: usize) -> StrongWidget {
let mut text = Text::new(format!("Message {i}: {BODY}"));
text.wrap = true;
let text = rsc.ui.widgets.add_strong(text).any();
let text = wtext(format!("Message {i}: {BODY}"))
.wrap(true)
.add_strong(rsc)
.any();
if image_every > 0 && i.is_multiple_of(image_every) {
let img = image::DynamicImage::new_rgba8(64, 64);
@@ -321,9 +322,7 @@ fn bench_redraw_big_text(chars: usize, redraws: usize) {
let content: String = (0..chars)
.map(|i| char::from(b'a' + (i % 26) as u8))
.collect();
let mut text = Text::new(content);
text.wrap = true;
let text = rsc.ui.widgets.add_strong(text);
let text = wtext(content).wrap(true).add_strong(&mut rsc);
let handle = text.weak();
let root = text.any();