mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
fonts: Make FontContext
thread-safe and share it per-Layout (#32205)
This allows sharing font templates, fonts, and platform fonts across layout threads. It's the first step toward storing web fonts in the layout versus the shared `FontCacheThread`. Now fonts and font groups have some locking (especially on FreeType), which will probably affect performance. On the other hand, we measured memory usage and this saves roughly 40 megabytes of memory when loading servo.org based on data from the memory profiler. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
8ec5344f70
commit
556bfb7dff
27 changed files with 437 additions and 500 deletions
|
@ -1239,7 +1239,7 @@ impl InlineFlow {
|
|||
/// `style` is the style of the block.
|
||||
pub fn minimum_line_metrics(
|
||||
&self,
|
||||
font_context: &mut LayoutFontContext,
|
||||
font_context: &LayoutFontContext,
|
||||
style: &ComputedValues,
|
||||
) -> LineMetrics {
|
||||
InlineFlow::minimum_line_metrics_for_fragments(
|
||||
|
@ -1255,7 +1255,7 @@ impl InlineFlow {
|
|||
/// `style` is the style of the block that these fragments belong to.
|
||||
pub fn minimum_line_metrics_for_fragments(
|
||||
fragments: &[Fragment],
|
||||
font_context: &mut LayoutFontContext,
|
||||
font_context: &LayoutFontContext,
|
||||
style: &ComputedValues,
|
||||
) -> LineMetrics {
|
||||
// As a special case, if this flow contains only hypothetical fragments, then the entire
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue