[buffer] Rename swap_buffers() to sync()

This commit is contained in:
Behdad Esfahbod 2022-01-04 10:52:05 -07:00
parent c5e5d5e0bc
commit bea5369c6d
11 changed files with 14 additions and 14 deletions

View File

@ -220,7 +220,7 @@ for script, constraints in sorted (constraints.items (), key=lambda s_c: script_
print (' default:') print (' default:')
print (' break;') print (' break;')
print (' }') print (' }')
print (' buffer->swap_buffers ();') print (' buffer->sync ();')
print ('}') print ('}')
print () print ()

View File

@ -839,7 +839,7 @@ struct StateTableDriver
} }
if (!c->in_place) if (!c->in_place)
buffer->swap_buffers (); buffer->sync ();
} }
public: public:

View File

@ -135,14 +135,14 @@ hb_segment_properties_overlay (hb_segment_properties_t *p,
* As an optimization, both info and out_info may point to the * As an optimization, both info and out_info may point to the
* same piece of memory, which is owned by info. This remains the * same piece of memory, which is owned by info. This remains the
* case as long as out_len doesn't exceed i at any time. * case as long as out_len doesn't exceed i at any time.
* In that case, swap_buffers() is mostly no-op and the glyph operations * In that case, sync() is mostly no-op and the glyph operations
* operate mostly in-place. * operate mostly in-place.
* *
* As soon as out_info gets longer than info, out_info is moved over * As soon as out_info gets longer than info, out_info is moved over
* to an alternate buffer (which we reuse the pos buffer for), and its * to an alternate buffer (which we reuse the pos buffer for), and its
* current contents (out_len entries) are copied to the new place. * current contents (out_len entries) are copied to the new place.
* *
* This should all remain transparent to the user. swap_buffers() then * This should all remain transparent to the user. sync() then
* switches info over to out_info and does housekeeping. * switches info over to out_info and does housekeeping.
*/ */
@ -386,7 +386,7 @@ hb_buffer_t::clear_positions ()
} }
void void
hb_buffer_t::swap_buffers () hb_buffer_t::sync ()
{ {
assert (have_output); assert (have_output);

View File

@ -271,7 +271,7 @@ struct hb_buffer_t
HB_INTERNAL void guess_segment_properties (); HB_INTERNAL void guess_segment_properties ();
HB_INTERNAL void swap_buffers (); HB_INTERNAL void sync ();
HB_INTERNAL void clear_output (); HB_INTERNAL void clear_output ();
HB_INTERNAL void clear_positions (); HB_INTERNAL void clear_positions ();

View File

@ -1890,7 +1890,7 @@ apply_string (OT::hb_ot_apply_context_t *c,
apply_forward (c, accel); apply_forward (c, accel);
if (!Proxy::inplace) if (!Proxy::inplace)
buffer->swap_buffers (); buffer->sync ();
} }
else else
{ {

View File

@ -392,7 +392,7 @@ preprocess_text_hangul (const hb_ot_shape_plan_t *plan HB_UNUSED,
*/ */
(void) buffer->next_glyph (); (void) buffer->next_glyph ();
} }
buffer->swap_buffers (); buffer->sync ();
} }
static void static void

View File

@ -96,7 +96,7 @@ hb_syllabic_insert_dotted_circles (hb_font_t *font,
else else
(void) buffer->next_glyph (); (void) buffer->next_glyph ();
} }
buffer->swap_buffers (); buffer->sync ();
} }

View File

@ -364,7 +364,7 @@ preprocess_text_thai (const hb_ot_shape_plan_t *plan,
buffer->merge_out_clusters (start - 1, end); buffer->merge_out_clusters (start - 1, end);
} }
} }
buffer->swap_buffers (); buffer->sync ();
/* If font has Thai GSUB, we are done. */ /* If font has Thai GSUB, we are done. */
if (plan->props.script == HB_SCRIPT_THAI && !plan->map.found_script[0]) if (plan->props.script == HB_SCRIPT_THAI && !plan->map.found_script[0])

View File

@ -435,7 +435,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
default: default:
break; break;
} }
buffer->swap_buffers (); buffer->sync ();
} }

View File

@ -375,7 +375,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
decompose_multi_char_cluster (&c, end, always_short_circuit); decompose_multi_char_cluster (&c, end, always_short_circuit);
} }
while (buffer->idx < count && buffer->successful); while (buffer->idx < count && buffer->successful);
buffer->swap_buffers (); buffer->sync ();
} }
@ -478,7 +478,7 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
if (info_cc (buffer->prev()) == 0) if (info_cc (buffer->prev()) == 0)
starter = buffer->out_len - 1; starter = buffer->out_len - 1;
} }
buffer->swap_buffers (); buffer->sync ();
} }
} }

View File

@ -566,7 +566,7 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
info.mask = buffer->cur().mask; info.mask = buffer->cur().mask;
(void) buffer->output_info (info); (void) buffer->output_info (info);
buffer->swap_buffers (); buffer->sync ();
} }
static void static void