From 194d4566ec054db03fa31d369a9f1c6cf4941e74 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 27 Oct 2010 23:09:10 -0400 Subject: [PATCH] Move buffer var allocation local --- src/hb-ot-layout-gpos-private.hh | 19 ++++++++++++++----- src/hb-ot-layout-private.hh | 2 -- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/hb-ot-layout-gpos-private.hh b/src/hb-ot-layout-gpos-private.hh index 490370962..782df5fee 100644 --- a/src/hb-ot-layout-gpos-private.hh +++ b/src/hb-ot-layout-gpos-private.hh @@ -34,6 +34,11 @@ HB_BEGIN_DECLS +/* buffer var allocations */ +#define attach_lookback() var.u16[0] /* number of glyphs to go back to attach this glyph to its base */ +#define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */ + + /* Shared Tables: ValueRecord, Anchor Table, and MarkArray */ typedef USHORT Value; @@ -402,9 +407,9 @@ struct MarkArray : ArrayOf /* Array of MarkRecords--in Coverage orde glyph_anchor.get_anchor (c->layout, c->buffer->info[glyph_pos].codepoint, &base_x, &base_y); hb_glyph_position_t &o = c->buffer->pos[c->buffer->i]; - o.x_offset = base_x - mark_x; - o.y_offset = base_y - mark_y; - o.back() = c->buffer->i - glyph_pos; + o.x_offset = base_x - mark_x; + o.y_offset = base_y - mark_y; + o.attach_lookback() = c->buffer->i - glyph_pos; c->buffer->i++; return true; @@ -1522,9 +1527,9 @@ GPOS::position_finish (hb_buffer_t *buffer) /* Handle attachments */ for (i = 0; i < len; i++) - if (pos[i].back()) + if (pos[i].attach_lookback()) { - unsigned int back = i - pos[i].back(); + unsigned int back = i - pos[i].attach_lookback(); pos[i].x_offset += pos[back].x_offset; pos[i].y_offset += pos[back].y_offset; @@ -1574,6 +1579,10 @@ static inline bool position_lookup (hb_apply_context_t *c, unsigned int lookup_i } +#undef attach_lookback +#undef cursive_chain + + HB_END_DECLS #endif /* HB_OT_LAYOUT_GPOS_PRIVATE_HH */ diff --git a/src/hb-ot-layout-private.hh b/src/hb-ot-layout-private.hh index 45136764d..8b475b4b0 100644 --- a/src/hb-ot-layout-private.hh +++ b/src/hb-ot-layout-private.hh @@ -42,8 +42,6 @@ HB_BEGIN_DECLS #define component() var1.u16[0] #define lig_id() var1.u16[1] #define gproperty() var2.u32 -#define back() var.u16[0] /* number of glyphs to go back for drawing current glyph */ -#define cursive_chain() var.i16[1] /* character to which this connects, may be positive or negative */ typedef enum { HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0001,