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 1a3ac708d63ad795e32ee6507f03cda27ca83cea..c8859c8a60d4eb9fea9c3dfcce3c06389c0391fb 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 9588d5e19a21d12aa4bd28cf6f791ddbf93f6b29..de7a2eb655581f07166cf57278101a0be3c4c5d2 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 849a20c1c1535659a4c75528c316619cbadd5273..38364a54189b53e353195a022d50fa6b58ea245f 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