<AWT Dev> RFR: 7183828: Invalid Image Variant when using anything other than BufferedImage
Sergey Bylokhov
serb at openjdk.java.net
Wed Sep 9 22:42:14 UTC 2020
On Wed, 9 Sep 2020 16:50:22 GMT, Phil Race <prr at openjdk.org> wrote:
> I have very mixed feelings about this whole idea.
> InvalidPipeException is being co-opted for a different purpose.
We already use this exception in such cases, and I think it is intended for this:
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/java2d/opengl/OGLMaskFill.java#L75
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/sun/java2d/NullSurfaceData.java#L92
> The user no longer gets a clear message that their image type isn't supported.
> Is there any specification we can point to ?
The spec for the Image class:
> * The abstract class {@code Image} is the superclass of all
> * classes that represent graphical images. The image must be
> * obtained in a platform-specific manner.
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/java/awt/Image.java#L40
Or the spec for the VolatileImage
> * This image should not be subclassed directly but should be created
> * by using the {@link java.awt.Component#createVolatileImage(int, int)
> * Component.createVolatileImage} or
> * {@link java.awt.GraphicsConfiguration#createCompatibleVolatileImage(int, int)
> * GraphicsConfiguration.createCompatibleVolatileImage(int, int)} methods.
https://github.com/openjdk/jdk/blob/master/src/java.desktop/share/classes/java/awt/image/VolatileImage.java#L74
-------------
PR: https://git.openjdk.java.net/jdk/pull/85
More information about the awt-dev
mailing list