From d0316a81f59a4e814b0af78797d915d7ce04d119 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 12 May 2010 23:34:52 -0400 Subject: [PATCH] Add buffer->swap() --- src/hb-buffer-private.hh | 68 ++++++++++++++++++++++------------------ src/hb-ot-layout-gsub-private.hh | 2 +- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/src/hb-buffer-private.hh b/src/hb-buffer-private.hh index c8859c8..b5e4550 100644 --- a/src/hb-buffer-private.hh +++ b/src/hb-buffer-private.hh @@ -62,37 +62,6 @@ ASSERT_STATIC (sizeof (hb_glyph_position_t) == sizeof (hb_internal_glyph_positio ASSERT_STATIC (sizeof (hb_glyph_info_t) == sizeof (hb_glyph_position_t)); -struct _hb_buffer_t { - hb_reference_count_t ref_count; - - /* Information about how the text in the buffer should be treated */ - hb_unicode_funcs_t *unicode; - hb_direction_t direction; - hb_script_t script; - hb_language_t language; - - /* Buffer contents */ - - unsigned int allocated; - - hb_bool_t have_output; /* whether we have an output buffer going on */ - hb_bool_t have_positions; /* whether we have positions */ - unsigned int in_length; - unsigned int out_length; - unsigned int in_pos; - unsigned int out_pos; /* out_length and out_pos are actually always the same */ - - hb_internal_glyph_info_t *in_string; - hb_internal_glyph_info_t *out_string; - hb_internal_glyph_position_t *positions; - - /* Other stuff */ - - unsigned int max_lig_id; - - inline unsigned int allocate_lig_id (void) { return max_lig_id++; } -}; - HB_INTERNAL void _hb_buffer_swap (hb_buffer_t *buffer); @@ -130,6 +99,43 @@ _hb_buffer_replace_glyph (hb_buffer_t *buffer, hb_codepoint_t glyph_index); + +struct _hb_buffer_t { + hb_reference_count_t ref_count; + + /* Information about how the text in the buffer should be treated */ + hb_unicode_funcs_t *unicode; + hb_direction_t direction; + hb_script_t script; + hb_language_t language; + + /* Buffer contents */ + + unsigned int allocated; + + hb_bool_t have_output; /* whether we have an output buffer going on */ + hb_bool_t have_positions; /* whether we have positions */ + unsigned int in_length; + unsigned int out_length; + unsigned int in_pos; + unsigned int out_pos; /* out_length and out_pos are actually always the same */ + + hb_internal_glyph_info_t *in_string; + hb_internal_glyph_info_t *out_string; + hb_internal_glyph_position_t *positions; + + /* Other stuff */ + + unsigned int max_lig_id; + + + /* Methods */ + inline unsigned int allocate_lig_id (void) { return max_lig_id++; } + inline void swap (void) { _hb_buffer_swap (this); } +}; + + + #ifndef BUFFER #define BUFFER buffer #endif diff --git a/src/hb-ot-layout-gsub-private.hh b/src/hb-ot-layout-gsub-private.hh index 38364a5..0101c4f 100644 --- a/src/hb-ot-layout-gsub-private.hh +++ b/src/hb-ot-layout-gsub-private.hh @@ -844,7 +844,7 @@ struct SubstLookup : Lookup } if (ret) - _hb_buffer_swap (buffer); + buffer->swap (); } else { -- 2.7.4