This commit is contained in:
Behdad Esfahbod 2012-07-30 19:31:17 -04:00
parent 05bd1b6342
commit 3dcbdc2125
1 changed files with 5 additions and 10 deletions

View File

@ -42,17 +42,12 @@
HB_SHAPER_DATA_ENSURE_DECLARE(ot, face) HB_SHAPER_DATA_ENSURE_DECLARE(ot, face)
static hb_bool_t
hb_ot_layout_ensure (hb_face_t *face)
{
return hb_ot_shaper_face_data_ensure (face);
}
hb_ot_layout_t * hb_ot_layout_t *
_hb_ot_layout_create (hb_face_t *face) _hb_ot_layout_create (hb_face_t *face)
{ {
hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t)); hb_ot_layout_t *layout = (hb_ot_layout_t *) calloc (1, sizeof (hb_ot_layout_t));
if (unlikely (!layout))
return NULL;
layout->gdef_blob = Sanitizer<GDEF>::sanitize (hb_face_reference_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->gdef = Sanitizer<GDEF>::lock_instance (layout->gdef_blob);
@ -79,19 +74,19 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout)
static inline const GDEF& static inline const GDEF&
_get_gdef (hb_face_t *face) _get_gdef (hb_face_t *face)
{ {
if (unlikely (!hb_ot_layout_ensure (face))) return Null(GDEF); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GDEF);
return *hb_ot_layout_from_face (face)->gdef; return *hb_ot_layout_from_face (face)->gdef;
} }
static inline const GSUB& static inline const GSUB&
_get_gsub (hb_face_t *face) _get_gsub (hb_face_t *face)
{ {
if (unlikely (!hb_ot_layout_ensure (face))) return Null(GSUB); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GSUB);
return *hb_ot_layout_from_face (face)->gsub; return *hb_ot_layout_from_face (face)->gsub;
} }
static inline const GPOS& static inline const GPOS&
_get_gpos (hb_face_t *face) _get_gpos (hb_face_t *face)
{ {
if (unlikely (!hb_ot_layout_ensure (face))) return Null(GPOS); if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(GPOS);
return *hb_ot_layout_from_face (face)->gpos; return *hb_ot_layout_from_face (face)->gpos;
} }