Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8272288

Funky multiresolution image breaks graphics context

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: 16, 17
    • Fix Version/s: 19
    • Component/s: client-libs
    • Labels:
    • Subcomponent:
      2d
    • Introduced In Version:
      16
    • OS:
      os_x

      Description

      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)

        Attachments

          Activity

            People

            Assignee:
            prr Philip Race
            Reporter:
            alans Alan Snyder
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: