mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 22:01:13 +00:00
Further preparation for more aggressive font caching
Pass everything needed for delayed evaluation for `PlatformWindow::font_metrics()` to permit caching the font matching result in the Text/TextInput's rendering cache.
This commit is contained in:
parent
a48b81022b
commit
47a255eea5
5 changed files with 55 additions and 19 deletions
|
@ -467,13 +467,14 @@ impl GLRenderer {
|
|||
/// closely as possible.
|
||||
fn font_metrics(
|
||||
&mut self,
|
||||
unresolved_request_fn: &dyn Fn() -> FontRequest,
|
||||
default_font_props_fn: &dyn Fn() -> FontRequest,
|
||||
scale_factor: f32,
|
||||
_item_graphics_cache: &sixtyfps_corelib::item_rendering::CachedRenderingData,
|
||||
font_request_fn: &dyn Fn() -> FontRequest,
|
||||
scale_factor: Pin<&Property<f32>>,
|
||||
_reference_text: Pin<&Property<SharedString>>,
|
||||
) -> Box<dyn FontMetrics> {
|
||||
Box::new(GLFontMetrics {
|
||||
request: unresolved_request_fn().merge(&default_font_props_fn()),
|
||||
scale_factor,
|
||||
request: font_request_fn(),
|
||||
scale_factor: scale_factor.get(),
|
||||
shared_data: self.shared_data.clone(),
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue