Simplify font resolution in the GL backend

The font resolution function querying fontdb is fast now, so we can
always call it when rendering text. That way we don't need all the
indirection in the text_size(), etc. functions, we don't need an entry
in the item graphics cache for the font and we can avoid a lot of
property dependencies.
This commit is contained in:
Simon Hausmann 2021-09-20 18:05:04 +02:00
parent 2f1db396e8
commit ac0cc85d33
7 changed files with 62 additions and 140 deletions

View file

@ -57,9 +57,8 @@ pub trait PlatformWindow {
/// When set, `max_width` means that one need to wrap the text so it does not go further than that
fn text_size(
&self,
item_graphics_cache: &crate::item_rendering::CachedRenderingData,
unresolved_font_request_getter: &dyn Fn() -> crate::graphics::FontRequest,
text_getter: &dyn Fn() -> crate::SharedString,
font_request: crate::graphics::FontRequest,
text: &str,
max_width: Option<f32>,
) -> Size;