unsigned int cluster_end);
HB_INTERNAL void merge_clusters (unsigned int start,
- unsigned int end);
+ unsigned int end)
+ {
+ if (end - start < 2)
+ return;
+ merge_clusters_impl (start, end);
+ }
+ HB_INTERNAL void merge_clusters_impl (unsigned int start,
+ unsigned int end);
HB_INTERNAL void merge_out_clusters (unsigned int start,
unsigned int end);
/* Merge clusters for deleting current glyph, and skip it. */
}
void
-hb_buffer_t::merge_clusters (unsigned int start,
- unsigned int end)
+hb_buffer_t::merge_clusters_impl (unsigned int start,
+ unsigned int end)
{
#ifdef HB_NO_MERGE_CLUSTERS
return;
#endif
- if (unlikely (end - start < 2))
- return;
-
unsigned int cluster = info[start].cluster;
for (unsigned int i = start + 1; i < end; i++)
static void
hb_form_clusters (hb_buffer_t *buffer)
{
+ unsigned int base = 0;
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
for (unsigned int i = 1; i < count; i++)
- if (HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i])))
- buffer->merge_clusters (i - 1, i + 1);
+ {
+ if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i]))))
+ {
+ buffer->merge_clusters (base, i);
+ base = i;
+ }
+ }
+ buffer->merge_clusters (base, count);
}
static void