Jonah Williams 4367ca66ae [Impeller] Make porter duff blended atlas calls faster. (flutter/engine#44059)
This implements part of https://github.com/flutter/flutter/issues/131345

---

Makes all porter-duff draw atlas blending avoid subpass creation, by tweaking the existing porter duff shader to support per-vertex colors and output opacity. This requires a small trick: What the blend shaders and what (drawAtlas/drawVertices) consider the source and destination is reversed. That is a blend mode color filter treats the color as the source whereas drawVertices/drawAtlas treat their per-vertex colors as the destination. Therefore I cannot simply make all color inputs per vertex and use the exact same shaders :(

However, for the porter duff blends we should just be able to reverse the blend mode (srcover -> dstOver, xor->xor) (I'm pretty sure I did this correctly) so that the blending is still correct. I don't think we can do this for the advanced blends, but supporting those is less important than the common atlas blending parameters like dstIn.

This PR only updates drawAtlas.
2023-08-15 19:40:09 +00:00
..