summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2011-07-25 14:54:08 -0400
committerBehdad Esfahbod <behdad@behdad.org>2011-07-25 14:54:08 -0400
commit651e8dd79ec8eaca5ab75a61e8ce961ff7bd26eb (patch)
treec596c92f284bc172eec903dc255e47bd1280f743
parentc86f932015bdf5803572b0904d343d3bc033e009 (diff)
downloadharfbuzz-651e8dd79ec8eaca5ab75a61e8ce961ff7bd26eb.tar.gz
harfbuzz-651e8dd79ec8eaca5ab75a61e8ce961ff7bd26eb.tar.bz2
harfbuzz-651e8dd79ec8eaca5ab75a61e8ce961ff7bd26eb.zip
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.
-rw-r--r--src/hb-ot-layout-gsubgpos-private.hh1
-rw-r--r--src/hb-ot-layout.cc1
-rw-r--r--src/hb-ot-shape.cc10
3 files changed, 1 insertions, 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);