Start cleaning up buffer var allocation

I've messed up a lot of stuff recently, different parts of the
shaping process are stumbling on eachother's toes because
manually tracking what's in which buffer var is hard.  I'm
going to add some internal API to track those such that mistakes
are discovered as soon as they are introduced.
This commit is contained in:
Behdad Esfahbod 2011-07-25 14:54:08 -04:00
parent c86f932015
commit 651e8dd79e
3 changed files with 1 additions and 11 deletions

View File

@ -34,7 +34,6 @@
HB_BEGIN_DECLS
/* buffer var allocations */
#define lig_id() var2.u8[2] /* unique ligature id */
#define lig_comp() var2.u8[3] /* component number in the ligature (0 = base) */

View File

@ -444,6 +444,7 @@ void
hb_ot_layout_substitute_start (hb_buffer_t *buffer)
{
unsigned int count = buffer->len;
/* XXX */
for (unsigned int i = 0; i < count; i++)
buffer->info[i].var1.u32 = buffer->info[i].var2.u32 = 0;
}

View File

@ -170,14 +170,6 @@ hb_ensure_native_direction (hb_buffer_t *buffer)
}
}
static void
hb_reset_glyph_infos (hb_buffer_t *buffer)
{
unsigned int count = buffer->len;
for (unsigned int i = 0; i < count; i++)
buffer->info[i].var1.u32 = buffer->info[i].var2.u32 = 0;
}
/* Substitute */
@ -352,8 +344,6 @@ hb_ot_shape_execute_internal (hb_ot_shape_context_t *c)
/* Save the original direction, we use it later. */
c->target_direction = c->buffer->props.direction;
hb_reset_glyph_infos (c->buffer); /* BUFFER: Clear buffer var1 and var2 */
_hb_set_unicode_props (c->buffer); /* BUFFER: Set general_category and combining_class in var1 */
hb_form_clusters (c->buffer);