[morx] Simplify
This commit is contained in:
parent
ce3451dc2a
commit
b693fd0dc6
|
@ -384,12 +384,10 @@ struct LigatureEntry<true>
|
||||||
DEFINE_SIZE_STATIC (2);
|
DEFINE_SIZE_STATIC (2);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Flags>
|
static inline bool performAction (const Entry<EntryData> *entry)
|
||||||
static inline bool performAction (Flags flags)
|
{ return entry->flags & PerformAction; }
|
||||||
{ return flags & PerformAction; }
|
|
||||||
|
|
||||||
template <typename Entry, typename Flags>
|
static inline unsigned int ligActionIndex (const Entry<EntryData> *entry)
|
||||||
static inline unsigned int ligActionIndex (Entry &entry, Flags flags)
|
|
||||||
{ return entry->data.ligActionIndex; }
|
{ return entry->data.ligActionIndex; }
|
||||||
};
|
};
|
||||||
template <>
|
template <>
|
||||||
|
@ -408,13 +406,11 @@ struct LigatureEntry<false>
|
||||||
|
|
||||||
typedef void EntryData;
|
typedef void EntryData;
|
||||||
|
|
||||||
template <typename Flags>
|
static inline bool performAction (const Entry<EntryData> *entry)
|
||||||
static inline bool performAction (Flags flags)
|
{ return entry->flags & Offset; }
|
||||||
{ return flags & Offset; }
|
|
||||||
|
|
||||||
template <typename Entry, typename Flags>
|
static inline unsigned int ligActionIndex (const Entry<EntryData> *entry)
|
||||||
static inline unsigned int ligActionIndex (Entry &entry, Flags flags)
|
{ return entry->flags & 0x3FFF; }
|
||||||
{ return flags & 0x3FFF; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -458,16 +454,15 @@ struct LigatureSubtable
|
||||||
inline bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
|
inline bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
|
||||||
const Entry<EntryData> *entry)
|
const Entry<EntryData> *entry)
|
||||||
{
|
{
|
||||||
return LigatureEntryT::performAction (entry->flags);
|
return LigatureEntryT::performAction (entry);
|
||||||
}
|
}
|
||||||
inline bool transition (StateTableDriver<Types, EntryData> *driver,
|
inline bool transition (StateTableDriver<Types, EntryData> *driver,
|
||||||
const Entry<EntryData> *entry)
|
const Entry<EntryData> *entry)
|
||||||
{
|
{
|
||||||
hb_buffer_t *buffer = driver->buffer;
|
hb_buffer_t *buffer = driver->buffer;
|
||||||
unsigned int flags = entry->flags;
|
|
||||||
|
|
||||||
DEBUG_MSG (APPLY, nullptr, "Ligature transition at %d", buffer->idx);
|
DEBUG_MSG (APPLY, nullptr, "Ligature transition at %d", buffer->idx);
|
||||||
if (flags & LigatureEntryT::SetComponent)
|
if (entry->flags & LigatureEntryT::SetComponent)
|
||||||
{
|
{
|
||||||
if (unlikely (match_length >= ARRAY_LENGTH (match_positions)))
|
if (unlikely (match_length >= ARRAY_LENGTH (match_positions)))
|
||||||
return false;
|
return false;
|
||||||
|
@ -480,11 +475,11 @@ struct LigatureSubtable
|
||||||
DEBUG_MSG (APPLY, nullptr, "Set component at %d", buffer->out_len);
|
DEBUG_MSG (APPLY, nullptr, "Set component at %d", buffer->out_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LigatureEntryT::performAction (flags))
|
if (LigatureEntryT::performAction (entry))
|
||||||
{
|
{
|
||||||
DEBUG_MSG (APPLY, nullptr, "Perform action with %d", match_length);
|
DEBUG_MSG (APPLY, nullptr, "Perform action with %d", match_length);
|
||||||
unsigned int end = buffer->out_len;
|
unsigned int end = buffer->out_len;
|
||||||
unsigned int action_idx = LigatureEntryT::ligActionIndex (entry, flags);
|
unsigned int action_idx = LigatureEntryT::ligActionIndex (entry);
|
||||||
unsigned int action;
|
unsigned int action;
|
||||||
unsigned int ligature_idx = 0;
|
unsigned int ligature_idx = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue