vello_cpu: Support custom atlas size#1658
Conversation
324bc59 to
0820789
Compare
|
I can get behind configuring the atlas size, but not why you want to expose before_render/after_render? This is supposed to be abstracted away from the user. |
|
Oh, I see now this is in parley… I believe this is still using an older version of vello CPU, so the code hasn’t been updated yet. It should be possible to remove all of this. |
|
Another scenario is that after rendering, we can pass |
dd48b07 to
384f82f
Compare
I hope there is a more concise way. After rendering, cache it into GlyphAtlas, and subsequent users can easily obtain data from |
67bc973 to
e9bd487
Compare
|
By the way, I do want to warn you that the atlas caching API is still experimental and not meant for production use yet. While it seems to work, there are still a number of issues to resolve, especially around performance when zooming. |
e9bd487 to
aa109c3
Compare
Ok. I'll give feedback if there are any problems. Thanks. |
2256be9 to
16723f9
Compare
16723f9 to
f18bb11
Compare
448e213 to
46d3984
Compare
d41b96b to
582652b
Compare
…s when rendering large amounts of text
…s when rendering large amounts of text
Outside glifo, position corrected by bbox of colr glyph
8001702 to
93ff81c
Compare
| /// | ||
| /// This is used when `vello_cpu` renders a large amount of text to prevent | ||
| /// the new image from overwriting stale content from the previous one. | ||
| pub fn clear_tick(&mut self) { |
There was a problem hiding this comment.
Is there a better way to avoid this situation?
| )] | ||
| #[inline] | ||
| fn quantize_subpixel(frac: f32) -> u8 { | ||
| pub fn quantize_subpixel(frac: f32) -> u8 { |
There was a problem hiding this comment.
Expose this method, so we can create keys freely outside of glifo.
| impl Resources { | ||
| pub(crate) fn prepare_glyph_cache(&mut self, render_mode: RenderMode) { | ||
| /// Prepares the glyph cache. | ||
| pub fn prepare_glyph_cache(&mut self, render_mode: RenderMode) { |
There was a problem hiding this comment.
See https://gist.github.com/fundon/2fbf7f6b5d685bb8ed87174fcdafe867#file-fixed_pos_main-rs-L181-L188
Write to cache first, then process text.
ImageCacheintoResources, so the atlas size can be customizedimage_cachepixmapsglyph_atlas_mutmethods, users can read glyphsGlyphCacheKey