[>64k:layout] Templatize GSUBGPOSFormat1

This commit is contained in:
Behdad Esfahbod 2022-07-11 13:29:23 -06:00
parent 5fd0a3f0b9
commit 9ef9fc0114
3 changed files with 9 additions and 9 deletions

View File

@ -774,7 +774,7 @@ struct List16OfOffsetTo : ArrayOf<OffsetTo<Type, OffsetType>, HBUINT16>
bool sanitize (hb_sanitize_context_t *c, Ts&&... ds) const
{
TRACE_SANITIZE (this);
return_trace (Array16OfOffset16To<Type>::sanitize (c, this, std::forward<Ts> (ds)...));
return_trace ((Array16Of<OffsetTo<Type, OffsetType>>::sanitize (c, this, std::forward<Ts> (ds)...)));
}
};

View File

@ -1407,8 +1407,8 @@ struct Lookup
template <typename Types>
using LookupList = List16OfOffsetTo<Lookup, typename Types::HBUINT>;
template <typename TLookup>
struct LookupOffsetList : List16OfOffset16To<TLookup>
template <typename TLookup, typename OffsetType>
struct LookupOffsetList : List16OfOffsetTo<TLookup, OffsetType>
{
bool subset (hb_subset_context_t *c,
hb_subset_layout_context_t *l) const

View File

@ -4020,7 +4020,7 @@ struct GSUBGPOSVersion1_2
likely (version.major == 1) &&
scriptList.sanitize (c, this) &&
featureList.sanitize (c, this) &&
reinterpret_cast<const Offset16To<TLookupList> &> (lookupList).sanitize (c, this))))
reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this))))
return_trace (false);
#ifndef HB_NO_VAR
@ -4038,16 +4038,16 @@ struct GSUBGPOSVersion1_2
auto *out = c->subset_context->serializer->embed (*this);
if (unlikely (!out)) return_trace (false);
typedef LookupOffsetList<TLookup> TLookupList;
reinterpret_cast<Offset16To<TLookupList> &> (out->lookupList)
typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList;
reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList)
.serialize_subset (c->subset_context,
reinterpret_cast<const Offset16To<TLookupList> &> (lookupList),
reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList),
this,
c);
reinterpret_cast<Offset16To<RecordListOfFeature> &> (out->featureList)
reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList)
.serialize_subset (c->subset_context,
reinterpret_cast<const Offset16To<RecordListOfFeature> &> (featureList),
reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList),
this,
c);