Jonah Williams 41604c6b10 [Impeller] Fallback to no index buffer when tesselation count is large, split up nonZero contours. (flutter/engine#46282)
See example app in https://github.com/flutter/flutter/issues/135458

Because tessellation is generally nlogn best case (with allocation complexity as well), we can actually make it faster by breaking it into smaller pieces. For non zero fill modes, the contours can be tessellated individually without  losing fidelity.

In cases where this isn't possible, we need to check if we exceed the max uint16 index and fall back to no index buffer.

Fixes https://github.com/flutter/flutter/issues/135458

I Benchmarked signing my name.

### Before

 worst raster time 3+ seconds. Visual glitches

![flutter_03](https://github.com/flutter/engine/assets/8975114/7be57bd2-744f-4f0a-af0a-d2bd4fc9efaf)

### After
worst raster time 30 ms, looks correct (though my signature is still wrong)

![flutter_04](https://github.com/flutter/engine/assets/8975114/1fdf504e-7b4e-447a-8c29-063dd0ff34d0)
2023-09-27 17:11:08 +00:00
..