Add buffer->allocate_lig_id()
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 13 May 2010 03:13:39 +0000 (23:13 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 13 May 2010 03:13:39 +0000 (23:13 -0400)
src/hb-buffer-private.hh
src/hb-buffer.cc
src/hb-ot-layout-gsub-private.hh

index 1a3ac70..c8859c8 100644 (file)
@@ -89,6 +89,8 @@ struct _hb_buffer_t {
   /* Other stuff */
 
   unsigned int         max_lig_id;
+
+  inline unsigned int allocate_lig_id (void) { return max_lig_id++; }
 };
 
 
@@ -127,9 +129,6 @@ HB_INTERNAL void
 _hb_buffer_replace_glyph (hb_buffer_t *buffer,
                          hb_codepoint_t glyph_index);
 
-HB_INTERNAL unsigned short
-_hb_buffer_allocate_lig_id (hb_buffer_t *buffer);
-
 
 #ifndef BUFFER
 #define BUFFER buffer
index 9588d5e..de7a2eb 100644 (file)
@@ -450,12 +450,6 @@ _hb_buffer_replace_glyph (hb_buffer_t *buffer,
   _hb_buffer_add_output_glyph (buffer, glyph_index, 0xFFFF, 0xFFFF);
 }
 
-unsigned short
-_hb_buffer_allocate_lig_id (hb_buffer_t *buffer)
-{
-  return ++buffer->max_lig_id;
-}
-
 
 unsigned int
 hb_buffer_get_length (hb_buffer_t *buffer)
index 849a20c..38364a5 100644 (file)
@@ -404,10 +404,10 @@ struct Ligature
                                         1, (const uint16_t *) &ligGlyph,
                                         0,
                                         IN_LIGID (context->buffer->in_pos) && !IN_COMPONENT (context->buffer->in_pos) ?
-                                        0xFFFF : _hb_buffer_allocate_lig_id (context->buffer));
+                                        0xFFFF : context->buffer->allocate_lig_id ());
     else
     {
-      unsigned int lig_id = _hb_buffer_allocate_lig_id (context->buffer);
+      unsigned int lig_id = context->buffer->allocate_lig_id ();
       _hb_buffer_add_output_glyph (context->buffer, ligGlyph, 0xFFFF, lig_id);
 
       /* Now we must do a second loop to copy the skipped glyphs to