1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 07:10:04 -04:00

Fix tessellation of Shape::Vec of heterogenous TextureId:s (#1445)

Closes https://github.com/emilk/egui/issues/1443
This commit is contained in:
Emil Ernerfeldt
2022-04-03 18:14:27 +02:00
committed by GitHub
parent c2039920de
commit 10f30a0c52
7 changed files with 114 additions and 64 deletions

View File

@@ -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();
});
});