提交 08260c70 编写于 作者: B Behdad Esfahbod

[random] Shuffle

上级 71c9f84e
......@@ -543,10 +543,7 @@ struct AlternateSet
/* If alt_index is MAX, randomize feature if it is the rand feature. */
if (alt_index == HB_OT_MAP_MAX_VALUE && c->random)
{
c->random_state = (0x5DEECE66Dull * c->random_state + 11) & (((uint64_t) 1 << 48) - 1);
alt_index = (c->random_state >> 32) % count + 1;
}
alt_index = c->random_number () % count + 1;
if (unlikely (alt_index > count || alt_index == 0)) return_trace (false);
......
......@@ -521,6 +521,12 @@ struct hb_ot_apply_context_t :
iter_context.init (this, true);
}
inline uint32_t random_number (void)
{
random_state = (0x5DEECE66Dull * random_state + 11) & (((uint64_t) 1 << 48) - 1);
return random_state >> 32;
}
inline bool
match_properties_mark (hb_codepoint_t glyph,
unsigned int glyph_props,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册