Match other browsers by interpolating colors in floating point space rather than uint8_t space
Created attachment 423133 [details] Patch
This does seem to fix WPT results, though I am curious if there is a way to do this and stay in uint8_t space using more clever rounding. For each color channel, we are doing: premultiplication: float: color.red = color.red * color.alpha uint8_t: color.red = static_cast<uint8_t>(fastDivideBy255(color.red * color.alpha + 254)) blending: float: from + (to - from) * progress uint8_t: static_cast<int>(lround(static_cast<double>(from) + static_cast<double>(to - from) * progress)) unpremultiplication: float: color.red = color.red / color.alpha uint8_t: color.red = static_cast<uint8_t>((fastMultiplyBy255(color.red) + color.alpha - 1) / color.alpha)
Committed r274408: <https://commits.webkit.org/r274408> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423133 [details].
<rdar://problem/75419227>