Jonah Williams 458cbdd473 [Impeller] Use varying interpolation to compute some linear gradients. (flutter/engine#53166)
Create a fast gradient variant that assumes vertex interpolation is sufficient to compute the gradient color. This follows the approximate design from  https://github.com/flutter/flutter/issues/148651

This is only implemented for draws that are exactly horizontal or vertical gradients on a rectangle with an identity effect transform.  This could be easily extended to all horizontal or vertical gradients by extending the drawGeometry call to make the cover rect customizable. Handling diagonal gradients and effect transforms is more work but feasible.

this is sufficient to make https://github.com/flutter/flutter/issues/148496 about 2x as fast, at least for me. Applications with different gradients will not yet benefit.
2024-06-04 00:28:29 +00:00
..