Commit 74e951a7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

dwrite: Add flag for cached advance presence.

parent 68dc3d41
......@@ -66,6 +66,7 @@ struct cache_entry
struct cache_key key;
float advance;
unsigned int has_contours : 1;
unsigned int has_advance : 1;
};
static struct cache_entry * fontface_get_cache_entry(struct dwrite_fontface *fontface, const struct cache_key *key)
......@@ -97,9 +98,6 @@ static float fontface_get_glyph_advance(struct dwrite_fontface *fontface, float
{
if (!(entry = calloc(1, sizeof(*entry))))
return 0.0f;
entry->advance = font_funcs->get_glyph_advance(fontface->get_font_object(fontface), fontsize, glyph, mode, &value);
entry->has_contours = !!value;
entry->key = key;
size = fontface_get_cache_entry_size(entry);
......@@ -123,6 +121,13 @@ static float fontface_get_glyph_advance(struct dwrite_fontface *fontface, float
fontface->cache.size += size;
}
if (!entry->has_advance)
{
entry->advance = font_funcs->get_glyph_advance(fontface->get_font_object(fontface), fontsize, glyph, mode, &value);
entry->has_contours = !!value;
entry->has_advance = 1;
}
*has_contours = entry->has_contours;
return entry->advance;
}
......
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