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

Precompute the number of GlyphVertex instances generated by a Section? #170

Open
tareksander opened this issue Nov 17, 2023 · 4 comments
Open

Comments

@tareksander
Copy link

Is there a way to get the number of GlyphVertex instances that will be generated by the Section on the next process_queued call? I need to order the section drawing with other drawing operations, and for that I need to know which GlyphVertex instances came from which Section. I want to implement Skia-like SaveLayer functionality, which means I can't draw all the text at once, but have to switch rendering targets in between.

@tareksander
Copy link
Author

Or do I have to do my own thing with glyph_brush_layout and glyph_brush_draw_cache instead?

@alexheretic
Copy link
Owner

GlyphBrush is designed to render all vertices in a single draw.

If you need to do multiple draws one option is multiple GlyphBrush instances, one for each draw. See #157.

@tareksander
Copy link
Author

Is there an option to share the cache between instances?

@alexheretic
Copy link
Owner

Currently it isn't possible to share a single texture between GlyphBrush instances.

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

No branches or pull requests

2 participants