[PATCH 2/2] Remove duplicate assignment of repeat_type_uniform_location
Alan Coopersmith
alan.coopersmith at oracle.com
Sat Mar 8 11:20:03 PST 2014
cppcheck also flagged another instance in glamor for which I wasn't
sure which value was right:
[glamor/glamor_xv.c:301] -> [glamor/glamor_xv.c:316]: (performance)
Variable 'gamma' is reassigned a value before the old one has been used.
In glamor_display_textured_video() in this function, the code is
(with lines in question marked with =>):
cont = RTFContrast(port_priv->contrast);
bright = RTFBrightness(port_priv->brightness);
=> gamma = (float) port_priv->gamma / 1000.0;
uvcosf = RTFSaturation(port_priv->saturation) * cos(RTFHue(port_priv->hue));
uvsinf = RTFSaturation(port_priv->saturation) * sin(RTFHue(port_priv->hue));
/* overlay video also does pre-gamma contrast/sat adjust, should we? */
yco = trans[ref].RefLuma * cont;
uco[0] = -trans[ref].RefRCr * uvsinf;
uco[1] = trans[ref].RefGCb * uvcosf - trans[ref].RefGCr * uvsinf;
uco[2] = trans[ref].RefBCb * uvcosf;
vco[0] = trans[ref].RefRCr * uvcosf;
vco[1] = trans[ref].RefGCb * uvsinf + trans[ref].RefGCr * uvcosf;
vco[2] = trans[ref].RefBCb * uvsinf;
off[0] = Loff * yco + Coff * (uco[0] + vco[0]) + bright;
off[1] = Loff * yco + Coff * (uco[1] + vco[1]) + bright;
off[2] = Loff * yco + Coff * (uco[2] + vco[2]) + bright;
=> gamma = 1.0;
So is the calculated value or the hardcoded 1.0 the right one?
--
-Alan Coopersmith- alan.coopersmith at oracle.com
Oracle Solaris Engineering - http://blogs.oracle.com/alanc
More information about the xorg-devel
mailing list