On Wed, 9 Sep 2020 16:50:22 GMT, Phil Race <p...@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

Reply via email to