Nikolay Sivov : dwrite: Simplify single substitution helper.
Alexandre Julliard
julliard at winehq.org
Mon May 25 15:44:23 CDT 2020
Module: wine
Branch: master
Commit: db3eb6fc0babee4b99b615732b7c05caaf59e14b
URL: https://source.winehq.org/git/wine.git/?a=commit;h=db3eb6fc0babee4b99b615732b7c05caaf59e14b
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Mon May 25 14:54:31 2020 +0300
dwrite: Simplify single substitution helper.
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dwrite/opentype.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index bb62488330..abf9cba105 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -4420,6 +4420,7 @@ void opentype_layout_apply_gpos_features(struct scriptshaping_context *context,
static BOOL opentype_layout_apply_gsub_single_substitution(struct glyph_iterator *iter, const struct ot_lookup *lookup)
{
struct scriptshaping_cache *cache = iter->context->cache;
+ const struct dwrite_fonttable *gsub = &cache->gsub.table;
UINT16 format, coverage;
unsigned int i;
@@ -4436,10 +4437,9 @@ static BOOL opentype_layout_apply_gsub_single_substitution(struct glyph_iterator
if (format == 1)
{
- const struct ot_gsub_singlesubst_format1 *format1 = table_read_ensure(&cache->gsub.table, subtable_offset,
- sizeof(*format1));
+ const struct ot_gsub_singlesubst_format1 *format1 = table_read_ensure(gsub, subtable_offset, sizeof(*format1));
- coverage_index = opentype_layout_is_glyph_covered(&cache->gsub.table, subtable_offset + coverage, glyph);
+ coverage_index = opentype_layout_is_glyph_covered(gsub, subtable_offset + coverage, glyph);
if (coverage_index == GLYPH_NOT_COVERED)
continue;
@@ -4448,12 +4448,11 @@ static BOOL opentype_layout_apply_gsub_single_substitution(struct glyph_iterator
}
else if (format == 2)
{
- UINT16 count = table_read_be_word(&cache->gsub.table, subtable_offset +
- FIELD_OFFSET(struct ot_gsub_singlesubst_format2, count));
- const struct ot_gsub_singlesubst_format2 *format2 = table_read_ensure(&cache->gsub.table, subtable_offset,
+ UINT16 count = table_read_be_word(gsub, subtable_offset + FIELD_OFFSET(struct ot_gsub_singlesubst_format2, count));
+ const struct ot_gsub_singlesubst_format2 *format2 = table_read_ensure(gsub, subtable_offset,
FIELD_OFFSET(struct ot_gsub_singlesubst_format2, count) + count * sizeof(UINT16));
- coverage_index = opentype_layout_is_glyph_covered(&cache->gsub.table, subtable_offset + coverage, glyph);
+ coverage_index = opentype_layout_is_glyph_covered(gsub, subtable_offset + coverage, glyph);
if (coverage_index == GLYPH_NOT_COVERED || coverage_index >= count)
continue;
More information about the wine-cvs
mailing list