Jonah Williams a06a893374 [Impeller] Use Wang's formula for quad/cubic subdivision. (flutter/engine#52079)
Use a faster method to compute the number of subdivisions of quadradic and cubic curves. Unlike the adaptive subdivison we use this may give us more line segments around straight-ish parts of a curve ... but who cares! the rasterizer can handle it. This is enough to lop off about 2ms from the animated tessellation benchmark (5.5 to 3.5 on a Pixel 7), and there are some additional savings we can book by removing some of the incidental allocations. This part will be done in a follow up (https://github.com/flutter/engine/pull/52078).

### Before

![image](https://github.com/flutter/engine/assets/8975114/8dc45012-3999-4598-ac3b-713e09d5a31f)

### After

![image](https://github.com/flutter/engine/assets/8975114/8a90636f-9698-46e6-bd3f-2f47c8abdbba)

From looking at the proproptions I think this is in the 3x-5x faster range.

Code originally taken from https://github.com/google/skia/blob/main/src/gpu/tessellate/WangsFormula.h
2024-04-15 18:02:07 +00:00
..