mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
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  ### After  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