gl-renderer: move alpha pre-mult from YUV to RGB

Mathematically the result is the same, while multiplying RGB with alpha
is easier to understand as correct than the earlier form.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 4 years ago
parent a8d5ef4a04
commit 054ba37084
  1. 5
      libweston/renderer-gl/fragment.glsl

@ -57,12 +57,11 @@ yuva2rgba(float y, float u, float v, float a)
{
vec4 color_out;
y *= a;
u *= a;
v *= a;
color_out.r = y + 1.59602678 * v;
color_out.g = y - 0.39176229 * u - 0.81296764 * v;
color_out.b = y + 2.01723214 * u;
color_out.rgb *= a;
color_out.a = a;
return color_out;

Loading…
Cancel
Save