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

XToolkit is not correctly displayed color on 16-bit high color setting

    XMLWordPrintable

Details

    Backports

      Description

        While using 16-bit high color(R:5bit, G:6bit, B:5bit)graphics
        due to resource limitation, the background color of panel is specified as
        light gray, but the color of repaint area is not drawn by that color. In the
        case of background color setting, the value generated by
        sun.awt.image.PixelConverter class is used. However, when rendering like
        repaint, the value of Ushort565Rgb class which is an inner class of
        PixelConverter is used. Due to this difference in the values used, colors do
        not match.
        The difference between the two values is as follows:
            java.awt.image.ColorModel cm = new
        java.awt.image.DirectColorModel(16,0xf800,0x7e0,0x1f);
            ...
            A =
        sun.awt.image.PixelConverter.instance.rgbToPixel(java.awt.Color.lightGray,cm);
         // value of background color
            B =
        sun.awt.image.PixelConverter.Ushort565Rgb.instance.rgbToPixel(java.awt.Color.l
        ightGray,cm); //value of repaint color

            A -> #bdf7:10111 101111 10111
            B -> #c618:11000 110000 11000
            java.awt.Color.lightGray = #c0c0c0:11000000 11000000 11000000

        Each one is getting the correct value. 0xbdf7 is set as the background color
        of window and 0xc618 is set to the drawing color of fillRect() called by
        repaint. Therefore, when part of the Panel is redrawn, the phenomenon occurs
        that only the area is different in color.

        Attachments

          1. CMAP_vnc_Applet.png
            CMAP_vnc_Applet.png
            12 kB
          2. CMAP_vnc_Applet2.png
            CMAP_vnc_Applet2.png
            15 kB
          3. ColorSurvey.java
            0.9 kB
          4. index.html
            0.1 kB
          5. Main.java
            0.7 kB
          6. screenshot.PNG
            screenshot.PNG
            5 kB
          7. typescript
            0.4 kB

          Issue Links

            Activity

              People

                dmarkov Dmitry Markov
                shadowbug Shadow Bug
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: