From 651e8dd79ec8eaca5ab75a61e8ce961ff7bd26eb Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 25 Jul 2011 14:54:08 -0400 Subject: [PATCH] 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. --- src/hb-ot-layout-gsubgpos-private.hh | 1 - src/hb-ot-layout.cc | 1 + src/hb-ot-shape.cc | 10 ---------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos-private.hh b/src/hb-ot-layout-gsubgpos-private.hh index 2d07a6f..1d75253 100644 --- a/src/hb-ot-layout-gsubgpos-private.hh +++ b/src/hb-ot-layout-gsubgpos-private.hh @@ -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) */ diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index a49f339..1da4792 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -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; } diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index a1893ef..9b362bd 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -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); -- 2.7.4