From dd42939e318c90f2c0f7d0efc1c4354182552f72 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 10 Jan 2023 13:23:19 -0700 Subject: [PATCH] [aat] Reduce unsafe_to_concat calls --- src/hb-aat-layout-common.hh | 2 -- src/hb-aat-layout-kerx-table.hh | 2 ++ src/hb-aat-layout-morx-table.hh | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hb-aat-layout-common.hh b/src/hb-aat-layout-common.hh index 1e3a5aba6..efbb623ef 100644 --- a/src/hb-aat-layout-common.hh +++ b/src/hb-aat-layout-common.hh @@ -783,8 +783,6 @@ struct StateTableDriver if (!c->in_place) buffer->clear_output (); - buffer->unsafe_to_concat (); - int state = StateTableT::STATE_START_OF_TEXT; // If there's only one range, we already checked the flag. auto *last_range = ac->range_flags && (ac->range_flags->length > 1) ? &(*ac->range_flags)[0] : nullptr; diff --git a/src/hb-aat-layout-kerx-table.hh b/src/hb-aat-layout-kerx-table.hh index c96ca300e..0ea18343d 100644 --- a/src/hb-aat-layout-kerx-table.hh +++ b/src/hb-aat-layout-kerx-table.hh @@ -869,6 +869,8 @@ struct KerxTable bool apply (AAT::hb_aat_apply_context_t *c) const { + c->buffer->unsafe_to_concat (); + typedef typename T::SubTable SubTable; bool ret = false; diff --git a/src/hb-aat-layout-morx-table.hh b/src/hb-aat-layout-morx-table.hh index f34470b7b..a68ce1bf8 100644 --- a/src/hb-aat-layout-morx-table.hh +++ b/src/hb-aat-layout-morx-table.hh @@ -1154,6 +1154,9 @@ struct mortmorx const hb_aat_map_t &map) const { if (unlikely (!c->buffer->successful)) return; + + c->buffer->unsafe_to_concat (); + c->set_lookup_index (0); const Chain *chain = &firstChain; unsigned int count = chainCount;