Add hb_blob_ptr_t.destroy()
This commit is contained in:
parent
bb9abb4efd
commit
da6aa3b033
@ -97,6 +97,7 @@ struct hb_blob_ptr_t
|
|||||||
inline const T * get (void) const { return b->as<T> (); }
|
inline const T * get (void) const { return b->as<T> (); }
|
||||||
inline hb_blob_t * get_blob (void) const { return b.get_raw (); }
|
inline hb_blob_t * get_blob (void) const { return b.get_raw (); }
|
||||||
inline unsigned int get_length (void) const { return b.get ()->length; }
|
inline unsigned int get_length (void) const { return b.get ()->length; }
|
||||||
|
inline void destroy (void) { hb_blob_destroy (b.get ()); b = nullptr; }
|
||||||
|
|
||||||
hb_nonnull_ptr_t<hb_blob_t> b;
|
hb_nonnull_ptr_t<hb_blob_t> b;
|
||||||
};
|
};
|
||||||
|
@ -1050,7 +1050,7 @@ struct cmap
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (this->table.get_blob ());
|
this->table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool get_nominal_glyph (hb_codepoint_t unicode,
|
inline bool get_nominal_glyph (hb_codepoint_t unicode,
|
||||||
|
@ -392,8 +392,8 @@ struct CBDT
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (this->cblc.get_blob ());
|
this->cblc.destroy ();
|
||||||
hb_blob_destroy (this->cbdt.get_blob ());
|
this->cbdt.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool get_extents (hb_font_t *font, hb_codepoint_t glyph,
|
inline bool get_extents (hb_font_t *font, hb_codepoint_t glyph,
|
||||||
|
@ -146,7 +146,7 @@ struct sbix
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (table.get_blob ());
|
table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool has_data () const
|
inline bool has_data () const
|
||||||
|
@ -86,7 +86,7 @@ struct SVG
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (table.get_blob ());
|
table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const
|
inline hb_blob_t *reference_blob_for_glyph (hb_codepoint_t glyph_id) const
|
||||||
|
@ -254,8 +254,8 @@ struct glyf
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (loca_table.get_blob ());
|
loca_table.destroy ();
|
||||||
hb_blob_destroy (glyf_table.get_blob ());
|
glyf_table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -234,7 +234,7 @@ struct hmtxvmtx
|
|||||||
if (unlikely (!num_advances))
|
if (unlikely (!num_advances))
|
||||||
{
|
{
|
||||||
num_metrics = num_advances = 0;
|
num_metrics = num_advances = 0;
|
||||||
hb_blob_destroy (table.get_blob ());
|
table.destroy ();
|
||||||
table = hb_blob_get_empty ();
|
table = hb_blob_get_empty ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -243,8 +243,8 @@ struct hmtxvmtx
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (table.get_blob ());
|
table.destroy ();
|
||||||
hb_blob_destroy (var_table.get_blob ());
|
var_table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO Add variations version. */
|
/* TODO Add variations version. */
|
||||||
|
@ -412,7 +412,7 @@ struct GDEF
|
|||||||
|
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
hb_blob_destroy (this->table.get_blob ());
|
this->table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_blob_ptr_t<GDEF> table;
|
hb_blob_ptr_t<GDEF> table;
|
||||||
|
@ -2769,7 +2769,7 @@ struct GSUBGPOS
|
|||||||
for (unsigned int i = 0; i < this->lookup_count; i++)
|
for (unsigned int i = 0; i < this->lookup_count; i++)
|
||||||
this->accels[i].fini ();
|
this->accels[i].fini ();
|
||||||
free (this->accels);
|
free (this->accels);
|
||||||
hb_blob_destroy (this->table.get_blob ());
|
this->table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
hb_blob_ptr_t<T> table;
|
hb_blob_ptr_t<T> table;
|
||||||
|
@ -220,7 +220,7 @@ struct name
|
|||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
this->names.fini ();
|
this->names.fini ();
|
||||||
hb_blob_destroy (this->table.get_blob ());
|
this->table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int get_index (hb_ot_name_id_t name_id,
|
inline int get_index (hb_ot_name_id_t name_id,
|
||||||
|
@ -123,7 +123,7 @@ struct post
|
|||||||
{
|
{
|
||||||
index_to_offset.fini ();
|
index_to_offset.fini ();
|
||||||
free (gids_sorted_by_name.get ());
|
free (gids_sorted_by_name.get ());
|
||||||
hb_blob_destroy (table.get_blob ());
|
table.destroy ();
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool get_glyph_name (hb_codepoint_t glyph,
|
inline bool get_glyph_name (hb_codepoint_t glyph,
|
||||||
|
Loading…
Reference in New Issue
Block a user