Skip to content
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

Merged
merged 4 commits into from
Apr 23, 2024
Merged

Better glyph caching #555

merged 4 commits into from
Apr 23, 2024

Conversation

dfrg
Copy link
Collaborator

@dfrg dfrg commented Apr 21, 2024

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.

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 :(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Member

@xorgy xorgy left a 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.

@nicoburns
Copy link
Contributor

Does this cache all glyphs or only variable glyphs?

@dfrg
Copy link
Collaborator Author

dfrg commented Apr 21, 2024

Does this cache all glyphs or only variable glyphs?

It caches all glyphs now

@dfrg dfrg added this pull request to the merge queue Apr 23, 2024
Merged via the queue into main with commit 905d671 Apr 23, 2024
15 checks passed
@dfrg dfrg deleted the glyph_cache branch April 23, 2024 14:29
@waywardmonkeys waywardmonkeys added this to the Vello 0.2 release milestone May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants