[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    Re: [OpenJDK 2D-Dev] [11] RFR JDK-8195131: Dead code removal for changes present in JDK-8176795
From:       Prahalad Kumar Narayanan <prahalad.kumar.narayanan () oracle ! com>
Date:       2018-01-18 7:14:17
Message-ID: 7338f346-424e-40c2-a542-3c0dbc774dd6 () default
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic