Files
test2/source
Christoph Lendenfeld 255818a569 Animation: Common curve drawing for FCurves
Before this patch, the drawing code iterated the FCurve to see if there are any
curve interpolation types that can't easily be drawn. (Sinusoidal, Bounce, etc)
If it found one, it would fall back to evaluating the FCurve.

That meant in the worst case scenario it would iterate the whole FCurve
before even starting to draw.

This PR unifies the drawing logic for FCurves no matter their interpolation type.
If it encounters a key type that it can't draw, it falls back to samples, but only
for the current key.

To clarify that it renames `draw_fcurve_curve_bezts` to `draw_fcurve_curve_keys`

Curves with modifiers are still drawn with samples.

## Performance
Test setup: 6000f of dense data on 62 bones.
Only measuring the average draw time **per curve**.
All measurements were done at the same zoom level.

| - | before | after |
| - | - | - |
| only beziers | 28μs | 13μs |
| only elastic | 90μs | 60μs |
| mix (~1/2 of the view with elastic) | 110μs | 24μs |

The performance boost with "only elastic" can be explained by the fact that per key I can skip 1 call to `evaluate_fcurve`.  That is because I always start at an existing keyframe so I can use its position.

Pull Request: https://projects.blender.org/blender/blender/pulls/110764
2023-08-10 15:33:22 +02:00
..
2023-08-10 11:28:25 +10:00