[util] Simplify shape-consumer by removing buffer arg

pull/3121/head
Behdad Esfahbod 4 years ago
parent e014c6fa2d
commit fc0339eef0
  1. 5
      util/hb-ot-shape-closure.cc
  2. 3
      util/hb-subset.cc
  3. 4
      util/main-font-text.hh
  4. 5
      util/shape-consumer.hh

@ -48,13 +48,12 @@ struct shape_closure_consumer_t
this);
}
void init (hb_buffer_t *buffer_,
const font_options_t *font_opts)
void init (const font_options_t *font_opts)
{
glyphs = hb_set_create ();
font = hb_font_reference (font_opts->get_font ());
failed = false;
buffer = hb_buffer_reference (buffer_);
buffer = hb_buffer_create ();
}
void consume_line (const char *text,
unsigned int text_len,

@ -42,8 +42,7 @@ struct subset_consumer_t
subset_options.add_options (parser);
}
void init (hb_buffer_t *buffer_,
const font_options_t *font_opts)
void init (const font_options_t *font_opts)
{
face = hb_face_reference (hb_font_get_face (font_opts->get_font ()));
input = hb_subset_input_reference (subset_options.get_input ());

@ -78,9 +78,7 @@ struct main_font_text_t
if (!input.text && !input.text_file)
input.text_file = g_strdup ("-");
hb_buffer_t *buffer = hb_buffer_create ();
consumer.init (buffer, &font_opts);
hb_buffer_destroy (buffer);
consumer.init (&font_opts);
unsigned int text_len;
const char *text;

@ -40,12 +40,11 @@ struct shape_consumer_t
output.add_options (parser);
}
void init (hb_buffer_t *buffer_,
const font_options_t *font_opts)
void init (const font_options_t *font_opts)
{
font = hb_font_reference (font_opts->get_font ());
failed = false;
buffer = hb_buffer_reference (buffer_);
buffer = hb_buffer_create ();
output.init (buffer, font_opts);
}

Loading…
Cancel
Save