diff --git a/crates/font-manager/src/picker.rs b/crates/font-manager/src/picker.rs index e25ff17667..145c7b2fcf 100644 --- a/crates/font-manager/src/picker.rs +++ b/crates/font-manager/src/picker.rs @@ -730,6 +730,18 @@ pub struct FontPicker<'a> { host_picked: Option, } +/// How many times a closed [`FontPicker`] built its stop list on `ctx`, for regression trials. +#[cfg(feature = "screen-testing")] +#[derive(Clone, Copy, Default)] +struct StopBuilds(u64); + +/// How many times a closed [`FontPicker`] built its stop list on `ctx`. +#[doc(hidden)] +#[cfg(feature = "screen-testing")] +pub fn stop_builds(ctx: &egui::Context) -> u64 { + ctx.data(|data| data.get_temp::(egui::Id::unique("font_picker_stop_builds")).unwrap_or_default().0) +} + impl<'a> FontPicker<'a> { /// A picker named `label` over the family `family` of `catalog`. pub fn new(label: impl Into