[OpenJDK 2D-Dev] Request for Review: JDK-8162591 All existing gradient paint implementations have issues with coordinates/sizes larger than Short.MAX_VALUE (exactly) on any Linux systems

Jim Graham james.graham at oracle.com
Tue Sep 27 20:50:36 UTC 2016

All of those conditions are optimized equivalents to getting the determinant.

invert() is a destructive call, but since getTransform is documented to return a copy, that is fine - but 
getDeterminant() will involve less math to check the condition...


On 9/27/16 6:33 AM, Clemens Eisserer wrote:
> Hi Sergey
>> I guess you can use "getDeterminant()==0" to determine if this transform has
>> no inverse?
> Initially I had the same idea, but looking at the implementation of
> invert(), I found several different conditions leading to an
> NoninvertibleTransformException. So I decided to keep the call to
> invert(), as the code-path shouldn't be performance critical anyway.
> Best regards, Clemens

More information about the 2d-dev mailing list