[ot-shape] Skip the post-morx digest update if not applying GPOS (#6192)

The buffer digest is only consumed by the OT lookup-apply loop. After
morx substitution it exists solely for a following GPOS pass; when
positioning goes through kerx/kern instead, rebuilding it is wasted
work. Speeds up the Menlo/en-thelittleprince benchmark by 2%; shaping
outputs are unchanged on the AAT benchmark fonts.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Behdad EsfahbodandClaude Fable 5 authored and GitHub committed 2026-08-21 01:10:56 -06:00
1 parent cf30f712e7
commit d155a10dff
1 file changed
+4 -1
+4 -1
View File
@@ -922,7 +922,10 @@ hb_ot_substitute_plan (const hb_ot_shape_context_t *c)
{
hb_aat_layout_substitute (c->plan, c->font, c->buffer,
c->user_features, c->num_user_features);
c->buffer->update_digest ();
/* The buffer digest is only used by the OT lookup-apply loop;
* without GPOS ahead, nothing consumes it. */
if (c->plan->apply_gpos)
c->buffer->update_digest ();
}
else
#endif