perf(text): avoid duplicate SDF generation in SdfAtlas::build_atlas #1070

Closed
opened 2026-11-07 02:05:55 +00:00 by SakulFlee · 0 comments
Owner

SdfAtlas::build_atlas currently calls FontData::get_glyph(), which rasterizes the glyph and generates an SDF, then calls font.rasterize() and generate_sdf() again for the atlas. The first SDF result is discarded.

Reuse the glyph/SDF data from the first pass instead of doing the work twice. This applies to every text label and is independent of the shared-atlas work.

Acceptance criteria:

  • Each glyph is rasterized and SDF-generated once per atlas build.
  • Existing atlas output/tests are unchanged.
  • Startup label timing is measured before/after.
SdfAtlas::build_atlas currently calls FontData::get_glyph(), which rasterizes the glyph and generates an SDF, then calls font.rasterize() and generate_sdf() again for the atlas. The first SDF result is discarded. Reuse the glyph/SDF data from the first pass instead of doing the work twice. This applies to every text label and is independent of the shared-atlas work. Acceptance criteria: - Each glyph is rasterized and SDF-generated once per atlas build. - Existing atlas output/tests are unchanged. - Startup label timing is measured before/after.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SakulFlee/Orbital#1070
No description provided.