Use an aging system for caches

This commit is contained in:
be5invis 2021-04-21 20:28:24 -07:00
parent d312466556
commit 0930af652f
11 changed files with 61 additions and 37 deletions

View file

@ -41,7 +41,7 @@ function flattenSimpleGlyph(cache, skew, g) {
if (ck && cached) {
g.clearGeometry();
g.includeContours(CurveUtil.repToShape(cached), 0, 0);
cache.saveGF(ck, cached);
cache.refreshGF(ck);
} else {
const tfBack = new Transform(1, -skew, 0, 1, 0, 0);
const tfForward = new Transform(1, +skew, 0, 1, 0, 0);