[shape-plan] Minor

This commit is contained in:
Behdad Esfahbod 2018-11-11 22:51:34 -05:00
parent 420c9de644
commit 3e284e02c2
3 changed files with 24 additions and 20 deletions

View File

@ -68,11 +68,12 @@ _hb_apply_morx (hb_face_t *face)
hb_aat_layout_has_substitution (face);
}
hb_ot_shape_planner_t::hb_ot_shape_planner_t (const hb_shape_plan_t *master_plan) :
face (master_plan->face_unsafe),
props (master_plan->props),
map (face, &props),
aat_map (face, &props),
hb_ot_shape_planner_t::hb_ot_shape_planner_t (hb_face_t *face,
const hb_segment_properties_t *props) :
face (face),
props (*props),
map (face, props),
aat_map (face, props),
apply_morx (_hb_apply_morx (face)),
shaper (apply_morx ?
&_hb_ot_complex_shaper_default :
@ -148,18 +149,19 @@ hb_ot_shape_planner_t::compile (hb_ot_shape_plan_t &plan,
}
bool
hb_ot_shape_plan_t::init0 (hb_shape_plan_t *shape_plan,
const hb_feature_t *user_features,
unsigned int num_user_features,
const int *coords,
unsigned int num_coords)
hb_ot_shape_plan_t::init0 (hb_face_t *face,
const hb_segment_properties_t *props,
const hb_feature_t *user_features,
unsigned int num_user_features,
const int *coords,
unsigned int num_coords)
{
map.init ();
aat_map.init ();
hb_ot_shape_planner_t planner (shape_plan);
hb_ot_shape_planner_t planner (face, props);
hb_ot_shape_collect_features (&planner, &shape_plan->props,
hb_ot_shape_collect_features (&planner, props,
user_features, num_user_features);
planner.compile (*this, coords, num_coords);

View File

@ -73,12 +73,12 @@ struct hb_ot_shape_plan_t
inline void substitute (hb_font_t *font, hb_buffer_t *buffer) const { map.substitute (this, font, buffer); }
inline void position (hb_font_t *font, hb_buffer_t *buffer) const { map.position (this, font, buffer); }
HB_INTERNAL bool init0 (hb_shape_plan_t *shape_plan,
const hb_feature_t *user_features,
unsigned int num_user_features,
const int *coords,
unsigned int num_coords);
HB_INTERNAL bool init0 (hb_face_t *face,
const hb_segment_properties_t *props,
const hb_feature_t *user_features,
unsigned int num_user_features,
const int *coords,
unsigned int num_coords);
HB_INTERNAL void fini (void);
};
@ -94,7 +94,8 @@ struct hb_ot_shape_planner_t
bool apply_morx : 1;
const struct hb_ot_complex_shaper_t *shaper;
HB_INTERNAL hb_ot_shape_planner_t (const hb_shape_plan_t *master_plan);
HB_INTERNAL hb_ot_shape_planner_t (hb_face_t *face,
const hb_segment_properties_t *props);
HB_INTERNAL void compile (hb_ot_shape_plan_t &plan,
const int *coords,

View File

@ -178,7 +178,8 @@ hb_shape_plan_create2 (hb_face_t *face,
coords, num_coords,
shaper_list);
if (unlikely (!shape_plan->ot.init0 (shape_plan,
if (unlikely (!shape_plan->ot.init0 (face,
props,
user_features,
num_user_features,
coords,