From e535e3f00f7f59076eb88b70e120d116a562cc4a Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Thu, 9 Jan 2025 17:38:22 +0000 Subject: [PATCH] Add more profiling info --- vello_encoding/src/glyph_cache.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/vello_encoding/src/glyph_cache.rs b/vello_encoding/src/glyph_cache.rs index 0ee4ca23..15e0b878 100644 --- a/vello_encoding/src/glyph_cache.rs +++ b/vello_encoding/src/glyph_cache.rs @@ -159,9 +159,16 @@ fn resolve_single_glyph( let font_id = font.data.id(); let font_index = font.index; let font = skrifa::FontRef::from_index(font.data.as_ref(), font.index).ok()?; - let outlines = font.outline_glyphs(); + + let outlines = { + let _span = tracing::trace_span!("Getting font outline builder").entered(); + font.outline_glyphs() + }; let size = Size::new(f32::from_bits(glyph.font_size_bits)); - let outline = outlines.get(GlyphId::new(glyph.glyph_id))?; + let outline = { + let _span = tracing::trace_span!("Getting Glyph Outline").entered(); + outlines.get(GlyphId::new(glyph.glyph_id))? + }; let mut encoding = Encoding::default(); encoding.reset(); let style: crate::Style = bytemuck::cast(glyph.style_bits); @@ -186,7 +193,10 @@ fn resolve_single_glyph( } else { DrawSettings::unhinted(size, &**coords) }; - outline.draw(draw_settings, &mut path).ok()?; + { + let _span = tracing::trace_span!("Drawing span").entered(); + outline.draw(draw_settings, &mut path).ok()?; + } if path.finish(false) == 0 { encoding.reset(); }