Improve the introspection paint stats

This commit is contained in:
Emil Ernerfeldt 2022-03-20 23:05:16 +01:00
parent e369626d3d
commit fde9c232b3
2 changed files with 10 additions and 7 deletions

View file

@ -101,11 +101,14 @@ impl Widget for &epaint::stats::PaintStats {
ui.label("Intermediate:"); ui.label("Intermediate:");
label(ui, shapes, "shapes").on_hover_text("Boxes, circles, etc"); label(ui, shapes, "shapes").on_hover_text("Boxes, circles, etc");
label(ui, shape_text, "text (mostly cached)"); ui.horizontal(|ui| {
label(ui, shape_text, "text");
ui.small("(mostly cached)");
});
label(ui, shape_path, "paths"); label(ui, shape_path, "paths");
label(ui, shape_mesh, "nested meshes"); label(ui, shape_mesh, "nested meshes");
label(ui, shape_vec, "nested shapes"); label(ui, shape_vec, "nested shapes");
ui.label(format!("{} callbacks", num_callbacks)); ui.label(format!("{:6} callbacks", num_callbacks));
ui.add_space(10.0); ui.add_space(10.0);
ui.label("Text shapes:"); ui.label("Text shapes:");
@ -115,7 +118,7 @@ impl Widget for &epaint::stats::PaintStats {
ui.add_space(10.0); ui.add_space(10.0);
ui.label("Tessellated (and culled):"); ui.label("Tessellated (and culled):");
label(ui, clipped_primitives, "clipped_primitives") label(ui, clipped_primitives, "primitives lists")
.on_hover_text("Number of separate clip rectangles"); .on_hover_text("Number of separate clip rectangles");
label(ui, vertices, "vertices"); label(ui, vertices, "vertices");
label(ui, indices, "indices").on_hover_text("Three 32-bit indices per triangles"); label(ui, indices, "indices").on_hover_text("Three 32-bit indices per triangles");

View file

@ -126,17 +126,17 @@ impl AllocInfo {
pub fn format(&self, what: &str) -> String { pub fn format(&self, what: &str) -> String {
if self.num_allocs() == 0 { if self.num_allocs() == 0 {
format!("{:6} {:14}", 0, what) format!("{:6} {:16}", 0, what)
} else if self.num_allocs() == 1 { } else if self.num_allocs() == 1 {
format!( format!(
"{:6} {:14} {} 1 allocation", "{:6} {:16} {} 1 allocation",
self.num_elements, self.num_elements,
what, what,
self.megabytes() self.megabytes()
) )
} else if self.element_size != ElementSize::Heterogenous { } else if self.element_size != ElementSize::Heterogenous {
format!( format!(
"{:6} {:14} {} {:3} allocations", "{:6} {:16} {} {:3} allocations",
self.num_elements(), self.num_elements(),
what, what,
self.megabytes(), self.megabytes(),
@ -144,7 +144,7 @@ impl AllocInfo {
) )
} else { } else {
format!( format!(
"{:6} {:14} {} {:3} allocations", "{:6} {:16} {} {:3} allocations",
"", "",
what, what,
self.megabytes(), self.megabytes(),