-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better glyph caching #555
Better glyph caching #555
Conversation
This enables caching for variable glyphs, adds support for pruning the cache and retains the Resolver in the Renderer struct so that glyphs can be cached across frames.
// 1. multiple lookups in the hashmap (implemented here) | ||
// 2. always allocate and copy the key | ||
// 3. use unsafe | ||
// Pick 1 bad option :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the lint error, I don't see anything here more than the most minor nitpicks.
It also works and doesn't cause crashing for me in example applications or Xilem, including when I exercise variable fonts.
Does this cache all glyphs or only variable glyphs? |
It caches all glyphs now |
This enables caching for variable glyphs, adds support for pruning the cache and retains the Resolver in the Renderer struct so that glyphs can be cached across frames.
Still so much to do here but this should remove our performance cliffs and better position us for future changes.