Bug 1698009 - Avoid negative Y values in brush_yuv_image that can break blending in SWGL. r=jrmuizel
Bug 1698009 - Avoid negative Y values in brush_yuv_image that can break blending in SWGL. r=jrmuizel

The line occurs due to the use of clip-masking creating a tile boundary. The SWGL YUV fast-path uses
saturated math and clamping to adequately deal with this issue, but when we fall off the fast-path
at the boundary, the main shader itself does not do any such clamping. When the generated negative
RGB values hit the blend stage and it tries to clip-mask it, it generates a bogus result.

To avoid this, it is sufficient to ensure that we clamp the Y value to be positive, if there is an
invalid Y value inside the headroom of the encoding space. This should only add a single SIMD
instruction to the alpha-pass variant without negatively impacting the other variants.

Differential Revision: https://phabricator.services.mozilla.com/D108983

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/5ae1cfa6fc115453ef9f21b4ce7d398cf7355974

servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender,servo/webrender