[OpenJDK 2D-Dev] [11] RFR JDK-8195131: Dead code removal for changes present in JDK-8176795

Philip Race philip.race at oracle.com
Tue Feb 6 08:43:13 UTC 2018

Looks fine. If anyone needs this in the future they can add back this or 
an overload that does the pre-multiplication.


On 1/18/18, 12:44 PM, Prahalad Kumar Narayanan wrote:
> Hello Jay
> I understand that the last argument to XRColor.setColorValues (int pixel, boolean pre) is set to 'true' at all caller sites.
> This results in block of code within if (!pre) { ... } not being used at all.
>     97         if (!pre) {
>     98             double alphaMult = XRUtils.XFixedToDouble(alpha);
>     99             this.red = (int) (red * alphaMult);
>   100             this.green = (int) (green * alphaMult);
>   101             this.blue = (int) (blue * alphaMult);
>   102         }
> Though the snippet is un-used presently, it is not an obsolete code because it helps to create XRColor from non pre-mulitplied alpha color.
> Hence, I would wish to retain the code from future perspective.
> The consolation here is that, we are addressing code removal as a separate fix. Thus a revert operation will be easy if need arises in future.
> So this should be fine. Kindly wait on other reviewers' opinion as well.
> Thank you
> Have a good day
> Prahalad N.
> ----- Original Message -----
> From: Jayathirth D V
> Sent: Thursday, January 18, 2018 11:49 AM
> To: 2d-dev
> Subject: [OpenJDK 2D-Dev] [11] RFR JDK-8195131: Dead code removal for changes present in JDK-8176795
> Hello All,
> Please review the following fix in JDK11 :
> Bug : https://bugs.openjdk.java.net/browse/JDK-8195131
> Webrev : http://cr.openjdk.java.net/~jdv/8195131/webrev.00/
> Issue: After changes present in https://bugs.openjdk.java.net/browse/JDK-8176795 the Non-Premultiplied alpha color to Premultiplied alpha color conversion code present under XRColor.setColorValues() is not reachable.
> Solution: While fixing https://bugs.openjdk.java.net/browse/JDK-8176795 we decided that we will remove this unreachable/dead code in separate bug so that in future if we need this color conversion code it will be easy to revert. As part of the fix dead code is removed along with minor changes at different files where XRColor.setColorValues() is used.
> Thanks,
> Jay

More information about the 2d-dev mailing list