[ot-shape] Pass reference to props instead of pointer

Since cannot be nullptr.
This commit is contained in:
Behdad Esfahbod 2022-07-17 21:56:56 -06:00
parent a972d05d7e
commit d57ce30054
5 changed files with 11 additions and 11 deletions

View File

@ -52,9 +52,9 @@ struct hb_aat_map_builder_t
public:
HB_INTERNAL hb_aat_map_builder_t (hb_face_t *face_,
const hb_segment_properties_t *props_) :
const hb_segment_properties_t props_) :
face (face_),
props (*props_) {}
props (props_) {}
HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value=1);

View File

@ -43,7 +43,7 @@ void hb_ot_map_t::collect_lookups (unsigned int table_index, hb_set_t *lookups_o
hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
const hb_segment_properties_t *props_)
const hb_segment_properties_t &props_)
{
memset (this, 0, sizeof (*this));
@ -52,7 +52,7 @@ hb_ot_map_builder_t::hb_ot_map_builder_t (hb_face_t *face_,
stages[table_index].init ();
face = face_;
props = *props_;
props = props_;
/* Fetch script/language indices for GSUB/GPOS. We need these later to skip
* features not available in either table and not waste precious bits for them. */

View File

@ -204,7 +204,7 @@ struct hb_ot_map_builder_t
public:
HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_,
const hb_segment_properties_t *props_);
const hb_segment_properties_t &props_);
HB_INTERNAL ~hb_ot_map_builder_t ();

View File

@ -53,11 +53,11 @@ _hb_codepoint_is_regional_indicator (hb_codepoint_t u)
#ifndef HB_NO_AAT_SHAPE
static inline bool
_hb_apply_morx (hb_face_t *face, const hb_segment_properties_t *props)
_hb_apply_morx (hb_face_t *face, const hb_segment_properties_t &props)
{
/* https://github.com/harfbuzz/harfbuzz/issues/2124 */
return hb_aat_layout_has_substitution (face) &&
(HB_DIRECTION_IS_HORIZONTAL (props->direction) || !hb_ot_layout_has_substitution (face));
(HB_DIRECTION_IS_HORIZONTAL (props.direction) || !hb_ot_layout_has_substitution (face));
}
#endif
@ -77,9 +77,9 @@ hb_ot_shape_collect_features (hb_ot_shape_planner_t *planner,
unsigned int num_user_features);
hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *face,
const hb_segment_properties_t *props) :
const hb_segment_properties_t &props) :
face (face),
props (*props),
props (props),
map (face, props),
aat_map (face, props)
#ifndef HB_NO_AAT_SHAPE
@ -225,7 +225,7 @@ hb_ot_shape_plan_t::init0 (hb_face_t *face,
#endif
hb_ot_shape_planner_t planner (face,
&key->props);
key->props);
hb_ot_shape_collect_features (&planner,
key->user_features,

View File

@ -161,7 +161,7 @@ struct hb_ot_shape_planner_t
const struct hb_ot_shaper_t *shaper;
HB_INTERNAL hb_ot_shape_planner_t (hb_face_t *face,
const hb_segment_properties_t *props);
const hb_segment_properties_t &props);
HB_INTERNAL void compile (hb_ot_shape_plan_t &plan,
const hb_ot_shape_plan_key_t &key);