From c2709119c8c610a0d4d71884a7d4fdba7cb65b72 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Oct 2010 23:18:51 -0400 Subject: [PATCH] Move things around some more --- src/hb-ot-layout-gpos-private.hh | 8 ++++---- src/hb-ot-layout-gsub-private.hh | 4 ++-- src/hb-ot-layout-gsubgpos-private.hh | 9 +++++++-- src/hb-ot-layout-private.hh | 7 +++---- src/hb-ot-layout.cc | 6 +++--- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 782df5fe..bcdbfe80 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -1100,9 +1100,9 @@ struct MarkLigPosFormat1 * is identical to the ligature ID of the found ligature. If yes, we * can directly use the component index. If not, we attach the mark * glyph to the last component of the ligature. */ - if (c->buffer->info[j].lig_id() && c->buffer->info[j].lig_id() == c->buffer->info[c->buffer->i].lig_id() && c->buffer->info[c->buffer->i].component()) + if (c->buffer->info[j].lig_id() && c->buffer->info[j].lig_id() == c->buffer->info[c->buffer->i].lig_id() && c->buffer->info[c->buffer->i].lig_comp()) { - comp_index = c->buffer->info[c->buffer->i].component() - 1; + comp_index = c->buffer->info[c->buffer->i].lig_comp() - 1; if (comp_index >= comp_count) comp_index = comp_count - 1; } @@ -1205,8 +1205,8 @@ struct MarkMarkPosFormat1 /* Two marks match only if they belong to the same base, or same component * of the same ligature. That is, the component numbers must match, and * if those are non-zero, the ligid number should also match. */ - if ((c->buffer->info[j].component() != c->buffer->info[c->buffer->i].component()) || - (c->buffer->info[j].component() && c->buffer->info[j].lig_id() != c->buffer->info[c->buffer->i].lig_id())) + if ((c->buffer->info[j].lig_comp() != c->buffer->info[c->buffer->i].lig_comp()) || + (c->buffer->info[j].lig_comp() && c->buffer->info[j].lig_id() != c->buffer->info[c->buffer->i].lig_id())) return false; unsigned int mark2_index = (this+mark2Coverage) (c->buffer->info[j].codepoint); diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index f63386bb..169290b5 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -372,7 +372,7 @@ struct Ligature /* Allocate new ligature id */ unsigned int lig_id = allocate_lig_id (c->buffer); - c->buffer->info[c->buffer->i].component() = 0; + c->buffer->info[c->buffer->i].lig_comp() = 0; c->buffer->info[c->buffer->i].lig_id() = lig_id; if (j == c->buffer->i + i) /* No input glyphs skipped */ @@ -394,7 +394,7 @@ struct Ligature { while (_hb_ot_layout_skip_mark (c->layout->face, &c->buffer->info[c->buffer->i], c->lookup_props, NULL)) { - c->buffer->info[c->buffer->i].component() = i; + c->buffer->info[c->buffer->i].lig_comp() = i; c->buffer->info[c->buffer->i].lig_id() = lig_id; c->replace_glyph (c->buffer->info[c->buffer->i].codepoint); } diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 5dd6b31d..afa27edc 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -35,6 +35,11 @@ HB_BEGIN_DECLS +/* buffer var allocations */ +#define lig_id() var2.u16[0] /* unique ligature id */ +#define lig_comp() var2.u16[1] /* component number in the ligature (0 = base) */ + + #ifndef HB_DEBUG_APPLY #define HB_DEBUG_APPLY HB_DEBUG+0 #endif @@ -72,13 +77,13 @@ struct hb_apply_context_t inline void guess_glyph_class (unsigned int klass) { -// buffer->info[buffer->i].gproperty() = klass; +// buffer->info[buffer->i].props_cache() = klass; } private: inline void clear_property (void) const { - buffer->info[buffer->i].gproperty() = 0; + buffer->info[buffer->i].props_cache() = 0; } }; diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 8b475b4b..dddbb604 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -38,10 +38,9 @@ HB_BEGIN_DECLS -/* XXX */ -#define component() var1.u16[0] -#define lig_id() var1.u16[1] -#define gproperty() var2.u32 +/* buffer var allocations */ +#define props_cache() var1.u16[0] /* glyph_props cache */ + typedef enum { HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0001, diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index fb6914d6..755b4837 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -106,13 +106,13 @@ unsigned int _hb_ot_layout_get_glyph_property (hb_face_t *face, hb_glyph_info_t *info) { - if (!info->gproperty()) + if (!info->props_cache()) { const GDEF &gdef = _get_gdef (face); - info->gproperty() = gdef.get_glyph_props (info->codepoint); + info->props_cache() = gdef.get_glyph_props (info->codepoint); } - return info->gproperty(); + return info->props_cache(); } hb_bool_t -- GitLab