[layout] Optimize buffer message calls

Those aren't exactly free. They were showing up in profiles.
This commit is contained in:
Behdad Esfahbod 2023-01-27 16:39:06 -07:00
parent 49d75ef331
commit da7b66c1f8
1 changed files with 5 additions and 3 deletions

View File

@ -1959,7 +1959,8 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
auto &lookup = lookups[table_index][i];
unsigned int lookup_index = lookup.index;
if (!buffer->message (font, "start lookup %u feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag))) continue;
if (buffer->messaging () &&
!buffer->message (font, "start lookup %u feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag))) continue;
/* c.digest is a digest of all the current glyphs in the buffer
* (plus some past glyphs).
@ -1978,9 +1979,10 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
proxy.table.get_lookup (lookup_index),
proxy.accels[lookup_index]);
}
else
else if (buffer->messaging ())
(void) buffer->message (font, "skipped lookup %u feature '%c%c%c%c' because no glyph matches", lookup_index, HB_UNTAG (lookup.feature_tag));
if (buffer->messaging ())
(void) buffer->message (font, "end lookup %u feature '%c%c%c%c'", lookup_index, HB_UNTAG (lookup.feature_tag));
}