mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-13 08:42:59 +00:00
[aat] For short words, use buffer digest to skip kerx machine subtables
Shows 3 / 4% speedup in fa-words test case with GeezaPro.
This commit is contained in:
parent
3ff9ebc868
commit
f536a416fd
1 changed files with 20 additions and 0 deletions
|
@ -367,6 +367,12 @@ struct KerxSubTableFormat1
|
|||
driver_context_t dc (this, c);
|
||||
|
||||
StateTableDriver<Types, EntryData> driver (machine, c->font->face);
|
||||
|
||||
if (driver.is_idempotent_on_all_out_of_bounds (&dc, c) &&
|
||||
!(c->buffer_digest.may_have (c->left_set) &&
|
||||
c->buffer_digest.may_have (c->right_set)))
|
||||
return_trace (false);
|
||||
|
||||
driver.drive (&dc, c);
|
||||
|
||||
return_trace (true);
|
||||
|
@ -635,6 +641,12 @@ struct KerxSubTableFormat4
|
|||
driver_context_t dc (this, c);
|
||||
|
||||
StateTableDriver<Types, EntryData> driver (machine, c->font->face);
|
||||
|
||||
if (driver.is_idempotent_on_all_out_of_bounds (&dc, c) &&
|
||||
!(c->buffer_digest.may_have (c->left_set) &&
|
||||
c->buffer_digest.may_have (c->right_set)))
|
||||
return_trace (false);
|
||||
|
||||
driver.drive (&dc, c);
|
||||
|
||||
return_trace (true);
|
||||
|
@ -919,6 +931,9 @@ struct KerxTable
|
|||
{
|
||||
if (st->get_type () == 1)
|
||||
return true;
|
||||
|
||||
// TODO: What about format 4? What's this API used for anyway?
|
||||
|
||||
st = &StructAfter<SubTable> (*st);
|
||||
}
|
||||
return false;
|
||||
|
@ -962,6 +977,11 @@ struct KerxTable
|
|||
{
|
||||
c->buffer->unsafe_to_concat ();
|
||||
|
||||
if (c->buffer->len < 16)
|
||||
c->buffer_digest = c->buffer->digest ();
|
||||
else
|
||||
c->buffer_digest = hb_set_digest_t::full ();
|
||||
|
||||
typedef typename T::SubTable SubTable;
|
||||
|
||||
bool ret = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue