[buffer] Make swap_buffers() copy rest

This commit is contained in:
Behdad Esfahbod 2020-06-28 20:30:39 -07:00
parent 86993c09a1
commit 9fcba109bf
5 changed files with 3 additions and 14 deletions

View File

@ -223,11 +223,7 @@ print (' default:')
print (' break;') print (' break;')
print (' }') print (' }')
print (' if (processed)') print (' if (processed)')
print (' {')
print (' if (buffer->idx < count)')
print (' buffer->next_glyph ();')
print (' buffer->swap_buffers ();') print (' buffer->swap_buffers ();')
print (' }')
print ('}') print ('}')
print () print ()

View File

@ -835,12 +835,8 @@ struct StateTableDriver
} }
if (!c->in_place) if (!c->in_place)
{
for (; buffer->successful && buffer->idx < buffer->len;)
buffer->next_glyph ();
buffer->swap_buffers (); buffer->swap_buffers ();
} }
}
public: public:
const StateTableT &machine; const StateTableT &machine;

View File

@ -333,6 +333,9 @@ hb_buffer_t::swap_buffers ()
{ {
if (unlikely (!successful)) return; if (unlikely (!successful)) return;
assert (idx <= len);
next_glyphs (len - idx);
assert (have_output); assert (have_output);
have_output = false; have_output = false;

View File

@ -452,11 +452,7 @@ _hb_preprocess_text_vowel_constraints (const hb_ot_shape_plan_t *plan HB_UNUSED,
break; break;
} }
if (processed) if (processed)
{
if (buffer->idx < count)
buffer->next_glyph ();
buffer->swap_buffers (); buffer->swap_buffers ();
}
} }

View File

@ -535,8 +535,6 @@ hb_insert_dotted_circle (hb_buffer_t *buffer, hb_font_t *font)
info.cluster = buffer->cur().cluster; info.cluster = buffer->cur().cluster;
info.mask = buffer->cur().mask; info.mask = buffer->cur().mask;
buffer->output_info (info); buffer->output_info (info);
while (buffer->idx < buffer->len && buffer->successful)
buffer->next_glyph ();
buffer->swap_buffers (); buffer->swap_buffers ();
} }