From 49c5ec51444f27f33e1eb6aa1959c61b08fa89c0 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 23 Jul 2012 20:14:13 -0400 Subject: [PATCH] Minor refactoring --- src/hb-ot-layout-gsubgpos-private.hh | 32 ------------------------- src/hb-ot-layout-private.hh | 35 ++++++++++++++++++++++++++++ src/hb-ot-shape-complex-indic.cc | 2 +- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index a26cc4f0..d50c6536 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -34,38 +34,6 @@ -/* unique ligature id */ -/* component number in the ligature (0 = base) */ -static inline void -set_lig_props (hb_glyph_info_t &info, unsigned int lig_id, unsigned int lig_comp) -{ - info.lig_props() = (lig_id << 4) | (lig_comp & 0x0F); -} -static inline unsigned int -get_lig_id (const hb_glyph_info_t &info) -{ - return info.lig_props() >> 4; -} -static inline unsigned int -get_lig_comp (const hb_glyph_info_t &info) -{ - return info.lig_props() & 0x0F; -} -static inline bool -is_a_ligature (const hb_glyph_info_t &info) -{ - return unlikely (get_lig_id (info) && ~get_lig_comp (info)); -} - -static inline uint8_t allocate_lig_id (hb_buffer_t *buffer) { - uint8_t lig_id = buffer->next_serial () & 0x0F; - if (unlikely (!lig_id)) - lig_id = allocate_lig_id (buffer); /* in case of overflow */ - return lig_id; -} - - - #ifndef HB_DEBUG_CLOSURE #define HB_DEBUG_CLOSURE (HB_DEBUG+0) #endif diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 366b0616..7a1c7e3f 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -64,6 +64,41 @@ _hb_ot_layout_skip_mark (hb_face_t *face, unsigned int *property_out); +/* + * GSUB/GPOS + */ + +/* unique ligature id */ +/* component number in the ligature (0 = base) */ +static inline void +set_lig_props (hb_glyph_info_t &info, unsigned int lig_id, unsigned int lig_comp) +{ + info.lig_props() = (lig_id << 4) | (lig_comp & 0x0F); +} +static inline unsigned int +get_lig_id (const hb_glyph_info_t &info) +{ + return info.lig_props() >> 4; +} +static inline unsigned int +get_lig_comp (const hb_glyph_info_t &info) +{ + return info.lig_props() & 0x0F; +} +static inline bool +is_a_ligature (const hb_glyph_info_t &info) +{ + return unlikely (get_lig_id (info) && ~get_lig_comp (info)); +} + +static inline uint8_t allocate_lig_id (hb_buffer_t *buffer) { + uint8_t lig_id = buffer->next_serial () & 0x0F; + if (unlikely (!lig_id)) + lig_id = allocate_lig_id (buffer); /* in case of overflow */ + return lig_id; +} + + /* * hb_ot_layout_t diff --git a/src/hb-ot-shape-complex-indic.cc b/src/hb-ot-shape-complex-indic.cc index 8b1d9757..e7b70c8e 100644 --- a/src/hb-ot-shape-complex-indic.cc +++ b/src/hb-ot-shape-complex-indic.cc @@ -26,7 +26,7 @@ #include "hb-ot-shape-complex-indic-private.hh" #include "hb-ot-shape-private.hh" -#include "hb-ot-layout-gsubgpos-private.hh" +#include "hb-ot-layout-private.hh" #define OLD_INDIC_TAG(script) (((hb_tag_t) script) | 0x20000000) #define IS_OLD_INDIC_TAG(tag) ( \ -- GitLab