From 11f4c87d01924cac43bf40044f67838440e19e42 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 30 Jul 2012 02:36:46 -0400 Subject: [PATCH] [OT] Remove hb_ot_layout_ensure() I didn't like it from the beginning. --- src/hb-ot-layout.cc | 9 +++++---- src/hb-ot-layout.h | 5 ----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-layout.cc b/src/hb-ot-layout.cc index a55714acf..c7f1f09c7 100644 --- a/src/hb-ot-layout.cc +++ b/src/hb-ot-layout.cc @@ -39,7 +39,8 @@ HB_SHAPER_DATA_ENSURE_DECLARE(ot, face) -hb_bool_t + +static hb_bool_t hb_ot_layout_ensure (hb_face_t *face) { return hb_ot_shaper_face_data_ensure (face); @@ -76,19 +77,19 @@ _hb_ot_layout_destroy (hb_ot_layout_t *layout) static inline const GDEF& _get_gdef (hb_face_t *face) { - /* XXX ensure ot_layout, and speed up */ + if (unlikely (!hb_ot_layout_ensure (face))) return Null(GDEF); return *hb_ot_layout_from_face (face)->gdef; } static inline const GSUB& _get_gsub (hb_face_t *face) { - /* XXX ensure ot_layout, and speed up */ + if (unlikely (!hb_ot_layout_ensure (face))) return Null(GSUB); return *hb_ot_layout_from_face (face)->gsub; } static inline const GPOS& _get_gpos (hb_face_t *face) { - /* XXX ensure ot_layout, and speed up */ + if (unlikely (!hb_ot_layout_ensure (face))) return Null(GPOS); return *hb_ot_layout_from_face (face)->gpos; } diff --git a/src/hb-ot-layout.h b/src/hb-ot-layout.h index af234789d..07e062f38 100644 --- a/src/hb-ot-layout.h +++ b/src/hb-ot-layout.h @@ -43,11 +43,6 @@ HB_BEGIN_DECLS #define HB_OT_TAG_GPOS HB_TAG('G','P','O','S') -/* Must call before all other funtions in this file. Idempotent. */ -hb_bool_t -hb_ot_layout_ensure (hb_face_t *face); - - /* * GDEF */