[OpenJDK 2D-Dev] RFR: 7183828 Invalid Image Variant when using anything other than BufferedImage
Sergey.Bylokhov at oracle.com
Thu Aug 27 17:20:39 UTC 2020
>> Also now we have more checks for specific known image types.
>> VolatileImage is an abstract class and I'm surprised that this is something this fix
>> considers OK for subclasses to extend. Does that really work ?
> This is a good question I'll double-check that.
You are right, we do not support the abstract VolatileImage class as well, and it
is not possible to fix this in a similar way as I did in the first revision,
because we get this exception for VolatileImage much early.
So I tried to fix it from the other way around. All our pipelines have a special
meaning of InvalidPipeException, if the pipeline found that it cannot complete draw
operation it throws this exception which is handled by all methods in the SunGraphics2D class.
So as a fix I suggest to change the IllegalArgumentException to the InvalidPipeException.
Also we need to add try/catch block to the drawHiDPIImage(it uses the
SurfaceManager.getManager method directly)
An updated version:
Best regards, Sergey.
More information about the 2d-dev