[buffer] Return delta from sync_so_far

This commit is contained in:
Behdad Esfahbod 2022-07-24 17:35:44 -06:00
parent c55c019771
commit 0722b627f4
2 changed files with 5 additions and 2 deletions

View File

@ -416,12 +416,13 @@ reset:
return ret;
}
void
int
hb_buffer_t::sync_so_far ()
{
bool had_output = have_output;
unsigned out_i = out_len;
unsigned i = idx;
unsigned old_idx = idx;
if (sync ())
idx = out_i;
@ -435,6 +436,8 @@ hb_buffer_t::sync_so_far ()
}
assert (idx <= len);
return idx - old_idx;
}
bool

View File

@ -289,7 +289,7 @@ struct hb_buffer_t
HB_INTERNAL void guess_segment_properties ();
HB_INTERNAL bool sync ();
HB_INTERNAL void sync_so_far ();
HB_INTERNAL int sync_so_far ();
HB_INTERNAL void clear_output ();
HB_INTERNAL void clear_positions ();