mirror of
https://github.com/emilk/egui.git
synced 2026-09-02 14:50:03 -04:00
Stop wrapping FontsImpl in an Arc<Mutex<_>>
We never need to clone it, and none of its methods took `self` as mutable, meaning it wasn't making use of the semantic difference between the two. This API is about to get reworked, and simplifying it is a first step.
This commit is contained in:
@@ -165,14 +165,13 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
let wrap_width = 512.0;
|
||||
let font_id = egui::FontId::default();
|
||||
let text_color = egui::Color32::WHITE;
|
||||
let fonts = egui::epaint::text::Fonts::new(
|
||||
let mut fonts = egui::epaint::text::Fonts::new(
|
||||
pixels_per_point,
|
||||
max_texture_side,
|
||||
egui::epaint::AlphaFromCoverage::default(),
|
||||
egui::FontDefinitions::default(),
|
||||
);
|
||||
{
|
||||
let mut locked_fonts = fonts.lock();
|
||||
c.bench_function("text_layout_uncached", |b| {
|
||||
b.iter(|| {
|
||||
use egui::epaint::text::{LayoutJob, layout};
|
||||
@@ -183,7 +182,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
|
||||
text_color,
|
||||
wrap_width,
|
||||
);
|
||||
layout(&mut locked_fonts.fonts, job.into())
|
||||
layout(&mut fonts.fonts, job.into())
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user