On Tue, 8 Sep 2020 21:16:10 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:
> It is intended that our draw machinery works only on specific image formats > that we know we support. > But the user still able to create some image subclasses for their purpose and > according to our spec of > Graphics2D.drawImage() we should not throw any exceptions. > > I suggest handling this situation in a similar way as we handle some errors > during rendering when > the pipeline is in the wrong state, or the ToolkitImage is not loaded yet, > just ignore the request and > return false. > > All our pipelines have a special meaning of InvalidPipeException, if the > pipeline found that it cannot complete the draw > operation throws this exception which is handled by all methods in the > SunGraphics2D class. > > So as a fix I suggest changing the IllegalArgumentException to the > InvalidPipeException. > Also, we need to add a try/catch block to the drawHiDPIImage(it uses the > SurfaceManager.getManager method directly) > > > Old review request: > https://mail.openjdk.java.net/pipermail/2d-dev/2020-August/010995.html I have very mixed feelings about this whole idea. InvalidPipeException is being co-opted for a different purpose. The user no longer gets a clear message that their image type isn't supported. Is there any specification we can point to ? ------------- PR: https://git.openjdk.java.net/jdk/pull/85