[API] Rename hb_face_get_table() to hb_face_reference_table()
That correctly reflects the reference ownership transfer happening.
This commit is contained in:
parent
2d7b61a4b0
commit
c035812feb
|
@ -319,7 +319,7 @@ hb_face_create_for_tables (hb_get_table_func_t get_table,
|
|||
|
||||
face->ot_layout = _hb_ot_layout_new (face);
|
||||
|
||||
face->head_blob = Sanitizer<head>::sanitize (hb_face_get_table (face, HB_OT_TAG_head));
|
||||
face->head_blob = Sanitizer<head>::sanitize (hb_face_reference_table (face, HB_OT_TAG_head));
|
||||
face->head_table = Sanitizer<head>::lock_instance (face->head_blob);
|
||||
|
||||
return face;
|
||||
|
@ -408,7 +408,7 @@ hb_face_destroy (hb_face_t *face)
|
|||
}
|
||||
|
||||
hb_blob_t *
|
||||
hb_face_get_table (hb_face_t *face,
|
||||
hb_face_reference_table (hb_face_t *face,
|
||||
hb_tag_t tag)
|
||||
{
|
||||
hb_blob_t *blob;
|
||||
|
|
|
@ -67,13 +67,10 @@ hb_face_destroy (hb_face_t *face);
|
|||
* table vs a zero-length table vs a very short table. It only leads to implementations
|
||||
* that check for non-NULL and assume that they've got a usable table going on... This
|
||||
* actually happened with Firefox.
|
||||
*
|
||||
* - It has to be renamed to reference_table() since unlike any other _get_ API, a reference
|
||||
* ownership transfer happens and the user is responsible to destroy the result.
|
||||
*/
|
||||
hb_blob_t *
|
||||
hb_face_get_table (hb_face_t *face,
|
||||
hb_tag_t tag);
|
||||
hb_face_reference_table (hb_face_t *face,
|
||||
hb_tag_t tag);
|
||||
|
||||
unsigned int
|
||||
hb_face_get_upem (hb_face_t *face);
|
||||
|
|
|
@ -47,13 +47,13 @@ _hb_ot_layout_new (hb_face_t *face)
|
|||
/* Remove this object altogether */
|
||||
hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
|
||||
|
||||
layout->gdef_blob = Sanitizer<GDEF>::sanitize (hb_face_get_table (face, HB_OT_TAG_GDEF));
|
||||
layout->gdef_blob = Sanitizer<GDEF>::sanitize (hb_face_reference_table (face, HB_OT_TAG_GDEF));
|
||||
layout->gdef = Sanitizer<GDEF>::lock_instance (layout->gdef_blob);
|
||||
|
||||
layout->gsub_blob = Sanitizer<GSUB>::sanitize (hb_face_get_table (face, HB_OT_TAG_GSUB));
|
||||
layout->gsub_blob = Sanitizer<GSUB>::sanitize (hb_face_reference_table (face, HB_OT_TAG_GSUB));
|
||||
layout->gsub = Sanitizer<GSUB>::lock_instance (layout->gsub_blob);
|
||||
|
||||
layout->gpos_blob = Sanitizer<GPOS>::sanitize (hb_face_get_table (face, HB_OT_TAG_GPOS));
|
||||
layout->gpos_blob = Sanitizer<GPOS>::sanitize (hb_face_reference_table (face, HB_OT_TAG_GPOS));
|
||||
layout->gpos = Sanitizer<GPOS>::lock_instance (layout->gpos_blob);
|
||||
|
||||
return layout;
|
||||
|
|
|
@ -48,7 +48,7 @@ hb_shape_internal (hb_font_t *font,
|
|||
{
|
||||
#if 0 && defined(HAVE_GRAPHITE)
|
||||
hb_blob_t *silf_blob;
|
||||
silf_blob = hb_face_get_table (face, HB_GRAPHITE_TAG_Silf);
|
||||
silf_blob = hb_face_reference_table (face, HB_GRAPHITE_TAG_Silf);
|
||||
if (hb_blob_get_length(silf_blob))
|
||||
{
|
||||
hb_graphite_shape(font, face, buffer, features, num_features);
|
||||
|
|
Loading…
Reference in New Issue