diff options
author | Grigori Goronzy <greg@blackbox> | 2011-07-29 04:21:48 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@blackbox> | 2011-07-29 04:44:56 +0200 |
commit | d7544850775344879dd3049046c5b7ce2d52d3b3 (patch) | |
tree | c90a7181ea8ff7be5382e33a1ccdec40f568ae2a /libass/ass_cache.c | |
parent | 2aff07ec62f1f2ef8462bb2954907ecca71288fa (diff) | |
download | libass-d7544850775344879dd3049046c5b7ce2d52d3b3.tar.bz2 libass-d7544850775344879dd3049046c5b7ce2d52d3b3.tar.xz |
harfbuzz: cache glyph metrics
HarfBuzz' FreeType font functions do not cache anything and call
FT_Load_Glyph all the time, which can be slow. Add a cache for metrics
and use it with custom font functions.
Diffstat (limited to 'libass/ass_cache.c')
-rw-r--r-- | libass/ass_cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libass/ass_cache.c b/libass/ass_cache.c index ece9a17..91801a0 100644 --- a/libass/ass_cache.c +++ b/libass/ass_cache.c @@ -331,6 +331,13 @@ Cache *ass_outline_cache_create(void) NULL, sizeof(OutlineHashKey), sizeof(OutlineHashValue)); } +Cache *ass_glyph_metrics_cache_create(void) +{ + return ass_cache_create(glyph_metrics_hash, glyph_metrics_compare, NULL, + (ItemSize) NULL, sizeof(GlyphMetricsHashKey), + sizeof(GlyphMetricsHashValue)); +} + Cache *ass_bitmap_cache_create(void) { return ass_cache_create(bitmap_hash, bitmap_compare, bitmap_destruct, |