mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
layout: Remove FontStyle
in favor of using the font style struct
directly, and optimize `get_layout_font_group()` to use a small vector. Seems to be a 38% layout win on a site I tested with a lot of text.
This commit is contained in:
parent
f3066c70da
commit
a6fcec468f
6 changed files with 52 additions and 87 deletions
|
@ -930,8 +930,8 @@ impl InlineFlow {
|
|||
return (Au(0), Au(0))
|
||||
}
|
||||
|
||||
let font_style = text::computed_style_to_font_style(style);
|
||||
let font_metrics = text::font_metrics_for_style(font_context, &font_style);
|
||||
let font_style = style.get_font();
|
||||
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);
|
||||
|
||||
|
@ -944,8 +944,8 @@ impl InlineFlow {
|
|||
match frag.inline_context {
|
||||
Some(ref inline_context) => {
|
||||
for style in inline_context.styles.iter() {
|
||||
let font_style = text::computed_style_to_font_style(&**style);
|
||||
let font_metrics = text::font_metrics_for_style(font_context, &font_style);
|
||||
let font_style = style.get_font();
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue