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

Consider adding some indirection around point drawing to speed up the TT2020 case #3

Open
ctrlcctrlv opened this issue Sep 14, 2020 · 1 comment

Comments

@ctrlcctrlv
Copy link
Contributor

Drawing TT2020 glyphs is possible, but renders on my machine at only around 15FPS. Not as bad as FontForge's 0.33FPS, but not ideal.

I think it's mostly due to how many paths we're creating. (perf backs this theory up if I'm reading it right.) I think I can solve this with a little good old fashioned indirection, by drawing every point that will be the same color/stroke width in a single path.

15 FPS:
image

60+ FPS:
image

(Also, we probably shouldn't draw selected points twice, but this isn't as big a problem as creating thousands of Paths/Paints.)

Rust iterators should make this easier. Basically the current draw_point will just add a rect/triangle/circle to a one-per-render_frame struct, then we'll draw all the points with only four or five Paths/Paints.

This might be post-1.0 as it's premature optimization, but am writing it down so don't forget.

@MatthewBlanchard
Copy link
Contributor

I'm going to look into batching the point/direction markers into a single path (well two with selected taken into account). This should improve performance for these types of cases.

@ctrlcctrlv ctrlcctrlv transferred this issue from MFEK/glif Jan 20, 2022
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