From 3e284e02c2a5da758526360a45364a330b8ab8e9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 11 Nov 2018 22:51:34 -0500 Subject: [PATCH] [shape-plan] Minor --- src/hb-ot-shape.cc | 26 ++++++++++++++------------ src/hb-ot-shape.hh | 15 ++++++++------- src/hb-shape-plan.cc | 3 ++- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/hb-ot-shape.cc b/src/hb-ot-shape.cc index 44cf39078..2500bcb8c 100644 --- a/src/hb-ot-shape.cc +++ b/src/hb-ot-shape.cc @@ -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); diff --git a/src/hb-ot-shape.hh b/src/hb-ot-shape.hh index 049830a66..9753752a2 100644 --- a/src/hb-ot-shape.hh +++ b/src/hb-ot-shape.hh @@ -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, diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 534d28960..0d51165ff 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -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,