1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05:40:03 -04:00

Add benchmark for text layout and tesselation

This commit is contained in:
Emil Ernerfeldt
2021-02-08 22:53:31 +01:00
parent f5431f308a
commit 1c415bd8fe
4 changed files with 46 additions and 4 deletions

View File

@@ -45,6 +45,13 @@ impl Mesh {
}
}
/// Restore to default state, but without freeing memory.
pub fn clear(&mut self) {
self.indices.clear();
self.vertices.clear();
self.vertices = Default::default();
}
pub fn bytes_used(&self) -> usize {
std::mem::size_of::<Self>()
+ self.vertices.len() * std::mem::size_of::<Vertex>()