back to retained...

This commit is contained in:
2025-11-17 13:55:49 -05:00
parent 2914d7968f
commit b6ece4a5ee
5 changed files with 519 additions and 26 deletions

491
flamegraph.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 93 KiB

BIN
perf.data Normal file

Binary file not shown.

View File

@@ -85,24 +85,24 @@ impl<'a> PainterCtx<'a> {
}; };
if let Some((rid, size)) = active.resize { if let Some((rid, size)) = active.resize {
let checked = &mut HashMap::default(); // let checked = &mut HashMap::default();
let mut ctx = SizeCtx { // let mut ctx = SizeCtx {
checked, // checked,
text: self.text, // text: self.text,
textures: self.textures, // textures: self.textures,
widgets: self.widgets, // widgets: self.widgets,
size: UiVec2::FULL_SIZE, // size: UiVec2::FULL_SIZE,
screen_size: self.screen_size, // screen_size: self.screen_size,
px_dependent: self.px_dependent, // px_dependent: self.px_dependent,
id, // id,
}; // };
let desired = ctx.size_inner(id, active.region.size()); // let desired = ctx.size_inner(id, active.region.size());
if size != desired { // if size != desired {
self.redraw(rid); self.redraw(rid);
if self.draw_started.contains(&id) { if self.draw_started.contains(&id) {
return; return;
} }
} // }
} }
let Some(active) = self.remove(id) else { let Some(active) = self.remove(id) else {
@@ -210,7 +210,9 @@ impl<'a> PainterCtx<'a> {
layer, layer,
}; };
for (cid, size) in sized_children { for (cid, size) in sized_children {
if let Some(w) = self.active.get_mut(&cid) { if let Some(w) = self.active.get_mut(&cid)
&& w.resize.is_none()
{
w.resize = Some((id, size)) w.resize = Some((id, size))
} }
} }

View File

@@ -134,14 +134,14 @@ impl Ui {
} }
fn redraw_updates(&mut self) { fn redraw_updates(&mut self) {
if self.updates.drain(..).next().is_some() { // if self.updates.drain(..).next().is_some() {
self.redraw_all(); // self.redraw_all();
}
// let mut ctx = PainterCtx::new(&mut self.data);
// for id in self.updates.drain(..) {
// ctx.redraw(id);
// } // }
// self.free(); let mut ctx = PainterCtx::new(&mut self.data);
for id in self.updates.drain(..) {
ctx.redraw(id);
}
self.free();
} }
/// free any resources that don't have references anymore /// free any resources that don't have references anymore

View File

@@ -3,8 +3,8 @@ use std::sync::Arc;
use app::App; use app::App;
use arboard::Clipboard; use arboard::Clipboard;
use cosmic_text::Family; use cosmic_text::Family;
use render::Renderer;
use iris::prelude::*; use iris::prelude::*;
use render::Renderer;
use winit::{event::WindowEvent, event_loop::ActiveEventLoop, window::Window}; use winit::{event::WindowEvent, event_loop::ActiveEventLoop, window::Window};
use crate::testing::input::Input; use crate::testing::input::Input;