Skip to content

Commit

Permalink
fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Apr 3, 2022
1 parent 0bf213b commit bd4d8c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions egui_demo_lib/benches/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,14 @@ pub fn criterion_benchmark(c: &mut Criterion) {
});

let galley = fonts.layout(LOREM_IPSUM_LONG.to_owned(), font_id, color, wrap_width);
let mut tessellator = egui::epaint::Tessellator::new(1.0, Default::default());
let font_image_size = fonts.font_image_size();
let mut tessellator =
egui::epaint::Tessellator::new(1.0, Default::default(), font_image_size);
let mut mesh = egui::epaint::Mesh::default();
let text_shape = TextShape::new(egui::Pos2::ZERO, galley);
let font_image_size = fonts.font_image_size();
c.bench_function("tessellate_text", |b| {
b.iter(|| {
tessellator.tessellate_text(font_image_size, &text_shape, &mut mesh);
tessellator.tessellate_text(&text_shape, &mut mesh);
mesh.clear();
});
});
Expand Down

0 comments on commit bd4d8c4

Please sign in to comment.