Commit b2d9d552 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Keep current lookup feature mask in context.

Lookups referenced from context-based lookups need to have access to original feature mask, set it once instead of propagating it on every recursive call. It's used for input matching and parametrized cases like alternate substitutions. Signed-off-by: 's avatarNikolay Sivov <nsivov@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 85566822
......@@ -585,6 +585,7 @@ struct scriptshaping_context
unsigned int range_count;
} user_features;
unsigned int global_mask;
unsigned int lookup_mask; /* Currently processed feature mask, set in main loop. */
struct shaping_glyph_info *glyph_infos;
unsigned int cur;
......
......@@ -4802,6 +4802,8 @@ void opentype_layout_apply_gpos_features(struct scriptshaping_context *context,
const struct lookup *lookup = &lookups.lookups[i];
context->cur = 0;
context->lookup_mask = lookup->mask;
while (context->cur < context->glyph_count)
{
ret = FALSE;
......@@ -5037,8 +5039,8 @@ static BOOL opentype_layout_apply_gsub_alt_substitution(struct scriptshaping_con
if (!count)
return FALSE;
BitScanForward(&shift, lookup->mask);
alt_index = (lookup->mask & context->glyph_infos[idx].mask) >> shift;
BitScanForward(&shift, context->lookup_mask);
alt_index = (context->lookup_mask & context->glyph_infos[idx].mask) >> shift;
if (alt_index > count || !alt_index)
return FALSE;
......@@ -5071,7 +5073,7 @@ static BOOL opentype_layout_context_match_input(const struct match_context *mc,
match_positions[0] = context->cur;
glyph_iterator_init(context, mc->lookup->flags, context->cur, count - 1, &iter);
iter.mask = mc->lookup->mask;
iter.mask = context->lookup_mask;
iter.match_func = mc->match_func;
iter.match_data = &match_data;
iter.glyph_data = input;
......@@ -5933,6 +5935,8 @@ void opentype_layout_apply_gsub_features(struct scriptshaping_context *context,
{
const struct lookup *lookup = &lookups.lookups[i];
context->lookup_mask = lookup->mask;
if (!opentype_is_gsub_lookup_reversed(context, lookup))
{
context->cur = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment