Lines Matching refs:buffer

63 hb_buffer_ensure( HB_Buffer buffer,  in hb_buffer_ensure()  argument
66 HB_UInt new_allocated = buffer->allocated; in hb_buffer_ensure()
75 if ( buffer->positions ) in hb_buffer_ensure()
77 if ( REALLOC_ARRAY( buffer->positions, new_allocated, HB_PositionRec ) ) in hb_buffer_ensure()
81 if ( REALLOC_ARRAY( buffer->in_string, new_allocated, HB_GlyphItemRec ) ) in hb_buffer_ensure()
84 if ( buffer->separate_out ) in hb_buffer_ensure()
86 if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) ) in hb_buffer_ensure()
89 buffer->out_string = buffer->alt_string; in hb_buffer_ensure()
93 buffer->out_string = buffer->in_string; in hb_buffer_ensure()
95 if ( buffer->alt_string ) in hb_buffer_ensure()
97 if ( REALLOC_ARRAY( buffer->alt_string, new_allocated, HB_GlyphItemRec ) ) in hb_buffer_ensure()
102 buffer->allocated = new_allocated; in hb_buffer_ensure()
109 hb_buffer_duplicate_out_buffer( HB_Buffer buffer ) in hb_buffer_duplicate_out_buffer() argument
111 if ( !buffer->alt_string ) in hb_buffer_duplicate_out_buffer()
115 if ( ALLOC_ARRAY( buffer->alt_string, buffer->allocated, HB_GlyphItemRec ) ) in hb_buffer_duplicate_out_buffer()
119 buffer->out_string = buffer->alt_string; in hb_buffer_duplicate_out_buffer()
120 …memcpy( buffer->out_string, buffer->in_string, buffer->out_length * sizeof (buffer->out_string[0])… in hb_buffer_duplicate_out_buffer()
121 buffer->separate_out = TRUE; in hb_buffer_duplicate_out_buffer()
131 HB_Buffer buffer; in hb_buffer_new() local
134 if ( ALLOC( buffer, sizeof( HB_BufferRec ) ) ) in hb_buffer_new()
137 buffer->allocated = 0; in hb_buffer_new()
138 buffer->in_string = NULL; in hb_buffer_new()
139 buffer->alt_string = NULL; in hb_buffer_new()
140 buffer->positions = NULL; in hb_buffer_new()
142 hb_buffer_clear( buffer ); in hb_buffer_new()
144 *pbuffer = buffer; in hb_buffer_new()
150 hb_buffer_free( HB_Buffer buffer ) in hb_buffer_free() argument
152 FREE( buffer->in_string ); in hb_buffer_free()
153 FREE( buffer->alt_string ); in hb_buffer_free()
154 buffer->out_string = NULL; in hb_buffer_free()
155 FREE( buffer->positions ); in hb_buffer_free()
156 FREE( buffer ); in hb_buffer_free()
160 hb_buffer_clear( HB_Buffer buffer ) in hb_buffer_clear() argument
162 buffer->in_length = 0; in hb_buffer_clear()
163 buffer->out_length = 0; in hb_buffer_clear()
164 buffer->in_pos = 0; in hb_buffer_clear()
165 buffer->out_pos = 0; in hb_buffer_clear()
166 buffer->out_string = buffer->in_string; in hb_buffer_clear()
167 buffer->separate_out = FALSE; in hb_buffer_clear()
168 buffer->max_ligID = 0; in hb_buffer_clear()
172 hb_buffer_add_glyph( HB_Buffer buffer, in hb_buffer_add_glyph() argument
180 error = hb_buffer_ensure( buffer, buffer->in_length + 1 ); in hb_buffer_add_glyph()
184 glyph = &buffer->in_string[buffer->in_length]; in hb_buffer_add_glyph()
192 buffer->in_length++; in hb_buffer_add_glyph()
200 _hb_buffer_clear_output( HB_Buffer buffer ) in _hb_buffer_clear_output() argument
202 buffer->out_length = 0; in _hb_buffer_clear_output()
203 buffer->out_pos = 0; in _hb_buffer_clear_output()
204 buffer->out_string = buffer->in_string; in _hb_buffer_clear_output()
205 buffer->separate_out = FALSE; in _hb_buffer_clear_output()
209 _hb_buffer_clear_positions( HB_Buffer buffer ) in _hb_buffer_clear_positions() argument
211 if ( !buffer->positions ) in _hb_buffer_clear_positions()
215 if ( ALLOC_ARRAY( buffer->positions, buffer->allocated, HB_PositionRec ) ) in _hb_buffer_clear_positions()
219 memset (buffer->positions, 0, sizeof (buffer->positions[0]) * buffer->in_length); in _hb_buffer_clear_positions()
225 _hb_buffer_swap( HB_Buffer buffer ) in _hb_buffer_swap() argument
231 if ( buffer->separate_out ) in _hb_buffer_swap()
233 tmp_string = buffer->in_string; in _hb_buffer_swap()
234 buffer->in_string = buffer->out_string; in _hb_buffer_swap()
235 buffer->out_string = tmp_string; in _hb_buffer_swap()
236 buffer->alt_string = buffer->out_string; in _hb_buffer_swap()
239 tmp_length = buffer->in_length; in _hb_buffer_swap()
240 buffer->in_length = buffer->out_length; in _hb_buffer_swap()
241 buffer->out_length = tmp_length; in _hb_buffer_swap()
243 tmp_pos = buffer->in_pos; in _hb_buffer_swap()
244 buffer->in_pos = buffer->out_pos; in _hb_buffer_swap()
245 buffer->out_pos = tmp_pos; in _hb_buffer_swap()
268 _hb_buffer_add_output_glyphs( HB_Buffer buffer, in _hb_buffer_add_output_glyphs() argument
280 error = hb_buffer_ensure( buffer, buffer->out_pos + num_out ); in _hb_buffer_add_output_glyphs()
284 if ( !buffer->separate_out ) in _hb_buffer_add_output_glyphs()
286 error = hb_buffer_duplicate_out_buffer( buffer ); in _hb_buffer_add_output_glyphs()
291 properties = buffer->in_string[buffer->in_pos].properties; in _hb_buffer_add_output_glyphs()
292 cluster = buffer->in_string[buffer->in_pos].cluster; in _hb_buffer_add_output_glyphs()
294 component = buffer->in_string[buffer->in_pos].component; in _hb_buffer_add_output_glyphs()
296 ligID = buffer->in_string[buffer->in_pos].ligID; in _hb_buffer_add_output_glyphs()
300 HB_GlyphItem item = &buffer->out_string[buffer->out_pos + i]; in _hb_buffer_add_output_glyphs()
310 buffer->in_pos += num_in; in _hb_buffer_add_output_glyphs()
311 buffer->out_pos += num_out; in _hb_buffer_add_output_glyphs()
313 buffer->out_length = buffer->out_pos; in _hb_buffer_add_output_glyphs()
319 _hb_buffer_add_output_glyph( HB_Buffer buffer, in _hb_buffer_add_output_glyph() argument
326 return _hb_buffer_add_output_glyphs ( buffer, 1, 1, in _hb_buffer_add_output_glyph()
331 _hb_buffer_copy_output_glyph ( HB_Buffer buffer ) in _hb_buffer_copy_output_glyph() argument
335 error = hb_buffer_ensure( buffer, buffer->out_pos + 1 ); in _hb_buffer_copy_output_glyph()
339 if ( buffer->separate_out ) in _hb_buffer_copy_output_glyph()
341 buffer->out_string[buffer->out_pos] = buffer->in_string[buffer->in_pos]; in _hb_buffer_copy_output_glyph()
344 buffer->in_pos++; in _hb_buffer_copy_output_glyph()
345 buffer->out_pos++; in _hb_buffer_copy_output_glyph()
346 buffer->out_length = buffer->out_pos; in _hb_buffer_copy_output_glyph()
352 _hb_buffer_replace_output_glyph( HB_Buffer buffer, in _hb_buffer_replace_output_glyph() argument
361 error = _hb_buffer_copy_output_glyph ( buffer ); in _hb_buffer_replace_output_glyph()
365 buffer->out_string[buffer->out_pos-1].gindex = glyph_index; in _hb_buffer_replace_output_glyph()
369 return _hb_buffer_add_output_glyph( buffer, glyph_index, 0xFFFF, 0xFFFF ); in _hb_buffer_replace_output_glyph()
376 _hb_buffer_allocate_ligid( HB_Buffer buffer ) in _hb_buffer_allocate_ligid() argument
378 buffer->max_ligID++; in _hb_buffer_allocate_ligid()
379 if (HB_UNLIKELY (buffer->max_ligID == 0)) in _hb_buffer_allocate_ligid()
380 buffer->max_ligID++; in _hb_buffer_allocate_ligid()
382 return buffer->max_ligID; in _hb_buffer_allocate_ligid()