Skip to content

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

@ctrlcctrlv

Description

@ctrlcctrlv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions