stylo: Store font metrics provider in thread local style context

This commit is contained in:
Manish Goregaokar 2017-04-04 11:11:27 -07:00 committed by Manish Goregaokar
parent 2ea8d61fbf
commit e402c72d0e
19 changed files with 158 additions and 35 deletions

View file

@ -73,11 +73,9 @@ impl FontRelativeLength {
/// font-family list.
pub fn find_first_available_font_metrics(context: &Context) -> Option<FontMetrics> {
use font_metrics::FontMetricsQueryResult::*;
if let Some(ref metrics_provider) = context.font_metrics_provider {
for family in context.style().get_font().font_family_iter() {
if let Available(metrics) = metrics_provider.query(family.atom()) {
return metrics;
}
for family in context.style().get_font().font_family_iter() {
if let Available(metrics) = context.font_metrics_provider.query(family.atom()) {
return metrics;
}
}