From 65456bff37ef61094c35574a35c96f6437fd6015 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 12 Nov 2018 16:15:26 -0500 Subject: [PATCH] [shape-plan] Minor --- src/hb-shape-plan.cc | 15 ++++++++------- src/hb-shape-plan.hh | 9 +++++---- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/hb-shape-plan.cc b/src/hb-shape-plan.cc index 4bd50abd0..a2467101f 100644 --- a/src/hb-shape-plan.cc +++ b/src/hb-shape-plan.cc @@ -161,7 +161,6 @@ hb_shape_plan_create2 (hb_face_t *face, face = hb_face_get_empty (); hb_face_make_immutable (face); - shape_plan->custom_shaper_list = shaper_list; shape_plan->face_unsafe = face; shape_plan->props = *props; shape_plan->num_user_features = num_user_features; @@ -172,7 +171,7 @@ hb_shape_plan_create2 (hb_face_t *face, shape_plan->coords = coords; if (num_coords) memcpy (coords, orig_coords, num_coords * sizeof (int)); - + shape_plan->custom_shaper_list = shaper_list; hb_shape_plan_choose_shaper (shape_plan, user_features, num_user_features, coords, num_coords, @@ -369,11 +368,11 @@ hb_shape_plan_hash (const hb_shape_plan_t *shape_plan) struct hb_shape_plan_proposal_t { const hb_segment_properties_t props; - const char * const *shaper_list; const hb_feature_t *user_features; unsigned int num_user_features; const int *coords; unsigned int num_coords; + bool custom_shaper_list; hb_shape_func_t *shaper_func; }; @@ -411,7 +410,7 @@ hb_shape_plan_matches (const hb_shape_plan_t *shape_plan, return hb_segment_properties_equal (&shape_plan->props, &proposal->props) && hb_shape_plan_user_features_match (shape_plan, proposal) && hb_shape_plan_coords_match (shape_plan, proposal) && - ((!shape_plan->custom_shaper_list && !proposal->shaper_list) || + ((!shape_plan->custom_shaper_list && !proposal->custom_shaper_list) || (shape_plan->shaper_func == proposal->shaper_func)); } @@ -477,17 +476,19 @@ hb_shape_plan_create_cached2 (hb_face_t *face, num_user_features, shaper_list); - hb_shape_plan_proposal_t proposal = { + hb_shape_plan_proposal_t proposal = + { *props, - shaper_list, user_features, num_user_features, coords, num_coords, + shaper_list, nullptr }; - if (shaper_list) { + if (shaper_list) + { /* Choose shaper. Adapted from hb_shape_plan_choose_shaper(). * Must choose shaper exactly the same way as that function. */ for (const char * const *shaper_item = shaper_list; *shaper_item; shaper_item++) diff --git a/src/hb-shape-plan.hh b/src/hb-shape-plan.hh index eaa84fd4b..2849e1808 100644 --- a/src/hb-shape-plan.hh +++ b/src/hb-shape-plan.hh @@ -37,11 +37,8 @@ struct hb_shape_plan_t hb_object_header_t header; hb_face_t *face_unsafe; /* We don't carry a reference to face. */ - bool custom_shaper_list; - hb_segment_properties_t props; - hb_shape_func_t *shaper_func; - const char *shaper_name; + hb_segment_properties_t props; hb_feature_t *user_features; unsigned int num_user_features; @@ -49,6 +46,10 @@ struct hb_shape_plan_t int *coords; unsigned int num_coords; + bool custom_shaper_list; + hb_shape_func_t *shaper_func; + const char *shaper_name; + hb_ot_shape_plan_t ot; };