[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

Clemens Eisserer linuxhippy at gmail.com
Mon Sep 26 19:50:27 UTC 2016


Thanks a lot for the feedback.

> The fix seems fine .. is there a possibility to have a regression test?
> Perhaps based on the code in the bug ?

Please find an automated regression test at:
http://93.83.133.214/8162591/HugeGradientTest.java

> Should we also check the transform?
> I guess we already do this in some way, but is it enough?

I was not 100% sure myself. As the Paint classes are stateless, there
is some overhead involved in checking the transformation in
isPaintValid (allocation of an additional AffineTransformation by
calling MultipleGradientPaint.getTransform() + additional call to
invert() as there is no isInvertible() method). I guess it doesn't
matter at all - considering how much else is going on when creating a
new GradientPaint.

Please find the updated webrev at: http://93.83.133.214/8162591/webrev.02/

Best regards, Clemens



More information about the 2d-dev mailing list