mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Cache last fontgroup. Style recalc on wikipedia/rust 66ms -> 41ms.
This commit is contained in:
parent
012a80cc18
commit
b1c226778f
6 changed files with 36 additions and 13 deletions
|
@ -859,7 +859,7 @@ impl InlineFlow {
|
|||
return (Au(0), Au(0))
|
||||
}
|
||||
|
||||
let font_style = style.get_font();
|
||||
let font_style = style.get_font_arc();
|
||||
let font_metrics = text::font_metrics_for_style(font_context, font_style);
|
||||
let line_height = text::line_height_from_style(style, &font_metrics);
|
||||
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics, line_height);
|
||||
|
@ -873,7 +873,7 @@ impl InlineFlow {
|
|||
match frag.inline_context {
|
||||
Some(ref inline_context) => {
|
||||
for style in inline_context.styles.iter() {
|
||||
let font_style = style.get_font();
|
||||
let font_style = style.get_font_arc();
|
||||
let font_metrics = text::font_metrics_for_style(font_context, font_style);
|
||||
let line_height = text::line_height_from_style(&**style, &font_metrics);
|
||||
let inline_metrics = InlineMetrics::from_font_metrics(&font_metrics,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue