Files
test/source
Christoph Lendenfeld 0d7b0045c6 Animation: Graph Editor curve drawing performance improvement
In current blender, when drawing curves in the Graph Editor,
it always iterates over the whole curve.
From first to last vertex no matter what is shown on screen.
Instead of that, find the bounding keyframes and iterate within them.

Additionally to that, break apart the logic into two sections
* first iterate over keyframes and add `float2` into a `Vector`
* then iterate over all those points and draw them

The second optimization is to make the Bezier resolution
dependent on the keyframe distance in screenspace.
Previously it just went off the distance between keys in frames,
but that doesn't make sense if you are zoomed out.

## Performance Numbers
The following performance numbers are the
average time **per curve** on a mocap file of 6000f (each frame has a key).
The numbers were generated **without** showing keyframes to only focus
on the performance of this patch.
Also they are from a debug build, so they just make sense relative to each other

| - | before | after |
| - | - | - |
| zoomed in | ~1000μs | ~77μs |
| zoomed out | ~1000μs | ~430μs |

This only affects the actual curves.
Keyframe and handle drawing can likely still be improved

Pull Request: https://projects.blender.org/blender/blender/pulls/110301
2023-08-03 14:43:21 +02:00
..