[shape-plan] Minor

This commit is contained in:
Behdad Esfahbod 2018-11-12 16:15:26 -05:00
parent 1db672a5e9
commit 65456bff37
2 changed files with 13 additions and 11 deletions

View File

@ -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++)

View File

@ -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;
};