提交 97e5913d 编写于 作者: B Behdad Esfahbod

Move more code

上级 c8f2d933
......@@ -2612,6 +2612,23 @@ struct Extension
* GSUB/GPOS Common
*/
struct hb_ot_layout_lookup_accelerator_t
{
template <typename TLookup>
inline void init (const TLookup &lookup)
{
digest.init ();
lookup.add_coverage (&digest);
}
inline void fini (void) {}
inline bool may_have (hb_codepoint_t g) const
{ return digest.may_have (g); }
private:
hb_set_digest_t digest;
};
struct GSUBGPOS
{
inline bool has_data (void) const { return version.to_int () != 0; }
......
......@@ -1094,7 +1094,7 @@ struct GSUBProxy
accels (hb_ot_face_data (face)->GSUB->accels) {}
const OT::GSUB &table;
const hb_ot_layout_lookup_accelerator_t *accels;
const OT::hb_ot_layout_lookup_accelerator_t *accels;
};
struct GPOSProxy
......@@ -1108,13 +1108,13 @@ struct GPOSProxy
accels (hb_ot_face_data (face)->GPOS->accels) {}
const OT::GPOS &table;
const hb_ot_layout_lookup_accelerator_t *accels;
const OT::hb_ot_layout_lookup_accelerator_t *accels;
};
static inline bool
apply_forward (OT::hb_ot_apply_context_t *c,
const hb_ot_layout_lookup_accelerator_t &accel,
const OT::hb_ot_layout_lookup_accelerator_t &accel,
const OT::hb_get_subtables_context_t::array_t &subtables)
{
bool ret = false;
......@@ -1144,7 +1144,7 @@ apply_forward (OT::hb_ot_apply_context_t *c,
static inline bool
apply_backward (OT::hb_ot_apply_context_t *c,
const hb_ot_layout_lookup_accelerator_t &accel,
const OT::hb_ot_layout_lookup_accelerator_t &accel,
const OT::hb_get_subtables_context_t::array_t &subtables)
{
bool ret = false;
......@@ -1174,7 +1174,7 @@ template <typename Proxy>
static inline void
apply_string (OT::hb_ot_apply_context_t *c,
const typename Proxy::Lookup &lookup,
const hb_ot_layout_lookup_accelerator_t &accel)
const OT::hb_ot_layout_lookup_accelerator_t &accel)
{
hb_buffer_t *buffer = c->buffer;
......@@ -1270,7 +1270,7 @@ void hb_ot_map_t::position (const hb_ot_shape_plan_t *plan, hb_font_t *font, hb_
void
hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c,
const OT::SubstLookup &lookup,
const hb_ot_layout_lookup_accelerator_t &accel)
const OT::hb_ot_layout_lookup_accelerator_t &accel)
{
apply_string<GSUBProxy> (c, lookup, accel);
}
......@@ -112,32 +112,16 @@ hb_ot_layout_substitute_start (hb_font_t *font,
hb_buffer_t *buffer);
struct hb_ot_layout_lookup_accelerator_t
{
template <typename TLookup>
inline void init (const TLookup &lookup)
{
digest.init ();
lookup.add_coverage (&digest);
}
inline void fini (void) {}
inline bool may_have (hb_codepoint_t g) const
{ return digest.may_have (g); }
private:
hb_set_digest_t digest;
};
namespace OT {
struct hb_ot_apply_context_t;
struct SubstLookup;
struct hb_ot_layout_lookup_accelerator_t;
}
HB_INTERNAL void
hb_ot_layout_substitute_lookup (OT::hb_ot_apply_context_t *c,
const OT::SubstLookup &lookup,
const hb_ot_layout_lookup_accelerator_t &accel);
const OT::hb_ot_layout_lookup_accelerator_t &accel);
/* Should be called before all the position_lookup's are done. */
......
......@@ -201,7 +201,7 @@ struct arabic_fallback_plan_t
hb_mask_t mask_array[ARABIC_FALLBACK_MAX_LOOKUPS];
OT::SubstLookup *lookup_array[ARABIC_FALLBACK_MAX_LOOKUPS];
hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS];
OT::hb_ot_layout_lookup_accelerator_t accel_array[ARABIC_FALLBACK_MAX_LOOKUPS];
};
#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_WIN1256)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册