提交 e4da3802 编写于 作者: B Behdad Esfahbod

[coretext/uniscribe/directwrite/graphite/fallback] Update for unsafe-to-break

Fixes https://github.com/behdad/harfbuzz/issues/615

We'll see which bots I broke.
上级 4de03a15
......@@ -305,7 +305,7 @@ struct hb_buffer_t {
info.cluster = cluster;
}
int
inline int
_unsafe_to_break_find_min_cluster (const hb_glyph_info_t *info,
unsigned int start, unsigned int end,
unsigned int cluster) const
......@@ -314,7 +314,7 @@ struct hb_buffer_t {
cluster = MIN<unsigned int> (cluster, info[i].cluster);
return cluster;
}
void
inline void
_unsafe_to_break_set_mask (hb_glyph_info_t *info,
unsigned int start, unsigned int end,
unsigned int cluster)
......@@ -326,6 +326,19 @@ struct hb_buffer_t {
info[i].mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
}
}
inline void
unsafe_to_break_all (void)
{
for (unsigned int i = 0; i < len; i++)
info[i].mask |= HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
}
inline void
safe_to_break_all (void)
{
for (unsigned int i = 0; i < len; i++)
info[i].mask &= ~HB_GLYPH_FLAG_UNSAFE_TO_BREAK;
}
};
......
......@@ -1262,6 +1262,8 @@ resize_and_retry:
}
}
buffer->unsafe_to_break_all ();
#undef FAIL
fail:
......
......@@ -927,8 +927,7 @@ hb_directwrite_shape_experimental_width(hb_font_t *font,
hb_bool_t res = _hb_directwrite_shape_full (shape_plan, font, buffer,
features, num_features, width);
if (res)
buffer->content_type = HB_BUFFER_CONTENT_TYPE_GLYPHS;
buffer->unsafe_to_break_all ();
return res;
}
......@@ -143,5 +143,7 @@ _hb_fallback_shape (hb_shape_plan_t *shape_plan HB_UNUSED,
if (HB_DIRECTION_IS_BACKWARD (direction))
hb_buffer_reverse (buffer);
buffer->safe_to_break_all ();
return true;
}
......@@ -416,5 +416,7 @@ _hb_graphite2_shape (hb_shape_plan_t *shape_plan,
if (feats) gr_featureval_destroy (feats);
gr_seg_destroy (seg);
buffer->unsafe_to_break_all ();
return true;
}
......@@ -1032,6 +1032,8 @@ retry:
if (backward)
hb_buffer_reverse (buffer);
buffer->unsafe_to_break_all ();
/* Wow, done! */
return true;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册