Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-03-31 16:24:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-03-31 20:32:53 +0300
commitf9691bae840a136ff0f55e8a99b42dd10f0fa8d8 (patch)
tree27dcc5a2e426c2560804ceb1e60a55ec061696fe /source/blender/blenfont/intern/blf.c
parent0ef38879b3adc200f65b24ab11e1134c6eeec161 (diff)
BLF: Perf: Add a kerning cache table for ascii chars.
This adds less than a megabyte of mem usage. FT_Get_Kerning was the 2nd hotspot when profilling. This commit completly remove this cost. One concern though: I don't know if the kerning data is constant for every sizes but it seems to be the case. I tested different fonts at different dpi scalling and saw no differences.
Diffstat (limited to 'source/blender/blenfont/intern/blf.c')
-rw-r--r--source/blender/blenfont/intern/blf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c
index 64a9f1739fd..df600feb1fe 100644
--- a/source/blender/blenfont/intern/blf.c
+++ b/source/blender/blenfont/intern/blf.c
@@ -144,8 +144,10 @@ void BLF_cache_clear(void)
for (i = 0; i < BLF_MAX_FONT; i++) {
font = global_font[i];
- if (font)
+ if (font) {
blf_glyph_cache_clear(font);
+ blf_kerning_cache_clear(font);
+ }
}
}