[util/hb-shape] Accept an empty output-format that would skip output

Useful for benchmarking, to avoid buffer serialization overhead (which
seems to by far dominate shaping!)
This commit is contained in:
Behdad Esfahbod 2014-07-08 20:02:29 -04:00
parent 8656408572
commit 9109f1e944
1 changed files with 4 additions and 1 deletions

View File

@ -48,7 +48,10 @@ struct output_buffer_t
output_format = HB_BUFFER_SERIALIZE_FORMAT_TEXT;
else
output_format = hb_buffer_serialize_format_from_string (options.output_format, -1);
if (!hb_buffer_serialize_format_to_string (output_format))
/* An empty "output_format" parameter basically skips output generating.
* Useful for benchmarking. */
if (*options.output_format &&
!hb_buffer_serialize_format_to_string (output_format))
{
if (options.explicit_output_format)
fail (false, "Unknown output format `%s'; supported formats are: %s",