[API] Rename hb_face_get_table() to hb_face_reference_table()
authorBehdad Esfahbod <behdad@behdad.org>
Wed, 20 Apr 2011 21:03:00 +0000 (17:03 -0400)
committerBehdad Esfahbod <behdad@behdad.org>
Wed, 20 Apr 2011 21:03:00 +0000 (17:03 -0400)
That correctly reflects the reference ownership transfer happening.

src/hb-font.cc
src/hb-font.h
src/hb-ot-layout.cc
src/hb-shape.cc

index 521120a..2475089 100644 (file)
@@ -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;
index 29cd5cb..397b586 100644 (file)
@@ -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);
index f1287c5..7990fe9 100644 (file)
@@ -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;
index 2b536fa..9d5d418 100644 (file)
@@ -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);