mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-14 17:13:40 +00:00
[GPOS] Sanitize Cursive positioning anchors lazily
Speeds up Duployan-Regular.otf load time by 30%. Doesn't seem to slow down shaping in a measurable way.
This commit is contained in:
parent
fcb9e5915f
commit
b382e616cc
1 changed files with 9 additions and 1 deletions
|
@ -91,7 +91,13 @@ struct CursivePosFormat1
|
|||
bool sanitize (hb_sanitize_context_t *c) const
|
||||
{
|
||||
TRACE_SANITIZE (this);
|
||||
return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
|
||||
if (unlikely (!coverage.sanitize (c, this)))
|
||||
return_trace (false);
|
||||
|
||||
if (c->lazy_some_gpos)
|
||||
return_trace (entryExitRecord.sanitize_shallow (c));
|
||||
else
|
||||
return_trace (entryExitRecord.sanitize (c, this));
|
||||
}
|
||||
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
|
@ -120,6 +126,7 @@ struct CursivePosFormat1
|
|||
|
||||
const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage (buffer->cur().codepoint)];
|
||||
if (!this_record.entryAnchor) return_trace (false);
|
||||
if (unlikely (!this_record.sanitize (&c->sanitizer, this))) return_trace (false);
|
||||
|
||||
hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
|
||||
skippy_iter.reset_fast (buffer->idx, 1);
|
||||
|
@ -136,6 +143,7 @@ struct CursivePosFormat1
|
|||
buffer->unsafe_to_concat_from_outbuffer (skippy_iter.idx, buffer->idx + 1);
|
||||
return_trace (false);
|
||||
}
|
||||
if (unlikely (!prev_record.sanitize (&c->sanitizer, this))) return_trace (false);
|
||||
|
||||
unsigned int i = skippy_iter.idx;
|
||||
unsigned int j = buffer->idx;
|
||||
|
|
Loading…
Add table
Reference in a new issue