Start cleaning up buffer var allocation
authorBehdad Esfahbod <behdad@behdad.org>
Mon, 25 Jul 2011 18:54:08 +0000 (14:54 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Mon, 25 Jul 2011 18:54:08 +0000 (14:54 -0400)
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
src/hb-ot-layout.cc
src/hb-ot-shape.cc

index 2d07a6f..1d75253 100644 (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) */
index a49f339..1da4792 100644 (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;
 }
index a1893ef..9b362bd 100644 (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);