mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-22 07:21:06 +01:00
[GDEF] Slight speedup in mark-set lookup
Avoids the nonnullptr overhead. 1% speedup in Duployan benchmark.
This commit is contained in:
1 parent
9e6929319b
commit
336958bd15
2 files changed
+8
-4
No files matched your search
@@ -721,7 +721,7 @@ struct GDEFVersion1_2
|
||||
out->version.minor = 3;
|
||||
c->plan->has_gdef_varstore = true;
|
||||
} else if (subset_markglyphsetsdef) {
|
||||
out->version.minor = 2;
|
||||
out->version.minor = 2;
|
||||
} else {
|
||||
out->version.minor = 0;
|
||||
c->serializer->revert (snapshot_version0);
|
||||
@@ -1003,14 +1003,14 @@ struct GDEF
|
||||
}
|
||||
|
||||
HB_ALWAYS_INLINE
|
||||
bool mark_set_covers (unsigned int set_index, hb_codepoint_t glyph_id) const
|
||||
bool mark_set_may_cover (unsigned int set_index, hb_codepoint_t glyph_id) const
|
||||
{
|
||||
return
|
||||
#ifndef HB_NO_GDEF_CACHE
|
||||
// We can access arrayZ directly because of sanitize_lookup_props() guarantee.
|
||||
mark_glyph_sets.arrayZ[set_index].may_have (glyph_id) &&
|
||||
#endif
|
||||
table->mark_set_covers (set_index, glyph_id)
|
||||
true
|
||||
;
|
||||
}
|
||||
|
||||
|
||||
@@ -851,7 +851,11 @@ struct hb_ot_apply_context_t :
|
||||
* match_props has the set index.
|
||||
*/
|
||||
if (match_props & LookupFlag::UseMarkFilteringSet)
|
||||
return gdef_accel.mark_set_covers (match_props >> 16, info->codepoint);
|
||||
{
|
||||
unsigned set_index = match_props >> 16;
|
||||
return gdef_accel.mark_set_may_cover (set_index, info->codepoint) &&
|
||||
gdef.mark_set_covers (set_index, info->codepoint);
|
||||
}
|
||||
|
||||
/* The second byte of match_props has the meaning
|
||||
* "ignore marks of attachment type different than
|
||||
|
||||
Reference in new issue
Block a user