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