-
Bug
-
Resolution: Fixed
-
P4
-
16, 17
-
None
I discovered this problem when a system service returned a 2x image with user size 28.0 x 0.5. I created a multiresolution image to preserve the extra resolution, but (erroneously) gave it a size of 28 x 0. Prior to JDK 16, this erroneous image was rejected when painted (see below). However, in JDK 16 and 17, there is no exception. Instead, the graphics context is apparently damaged. In this example, the label text is not painted. In other examples, it seems to have cleared the rendering buffer.
(Actually, I believe the exception is thrown but is caught internally, at which point different drawing code is used.)
The exception from JDK 15:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid Image variant
at java.desktop/sun.awt.image.SurfaceManager.getManager(SurfaceManager.java:82)
at java.desktop/sun.java2d.SurfaceData.getSourceSurfaceData(SurfaceData.java:219)
at java.desktop/sun.java2d.opengl.OGLDrawImage.renderImageXform(OGLDrawImage.java:62)
at java.desktop/sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:264)
at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:76)
at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1027)
at java.desktop/sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:186)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3425)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3401)
(Actually, I believe the exception is thrown but is caught internally, at which point different drawing code is used.)
The exception from JDK 15:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Invalid Image variant
at java.desktop/sun.awt.image.SurfaceManager.getManager(SurfaceManager.java:82)
at java.desktop/sun.java2d.SurfaceData.getSourceSurfaceData(SurfaceData.java:219)
at java.desktop/sun.java2d.opengl.OGLDrawImage.renderImageXform(OGLDrawImage.java:62)
at java.desktop/sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:264)
at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:76)
at java.desktop/sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:1027)
at java.desktop/sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:186)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3425)
at java.desktop/sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3401)
- relates to
-
JDK-8302169 That fallback code path in the RepaintManager does not support HiDPI
- Open