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

Image scaling is bad with D3D pipeline

    Details

    • Subcomponent:
      2d
    • Introduced In Version:
      9
    • CPU:
      x86
    • OS:
      other

      Description

      FULL PRODUCT VERSION :
      java version "9"
      Java(TM) SE Runtime Environment (build 9+181)
      Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 10

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      4K monitor

      A DESCRIPTION OF THE PROBLEM :
      Java 9 distorts BufferedImages when it automatically resizes screens. I'm suspecting it has something to do with this ==> http://openjdk.java.net/jeps/263 being delivered in Java 9.

      Related question asked on Stack Overflow with example output==>https://stackoverflow.com/questions/46736757/disable-automatic-rescaling-of-bufferedimage-in-jdk9

      REGRESSION. Last worked in version 8u144

      ADDITIONAL REGRESSION INFORMATION:
      java version "1.8.0_144"
      Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
      Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute attached source code on Windows 10 using Java 9.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Lines in buffered image should alternate between back and white (using attached source code)
      ACTUAL -
      Distortion of lines occur in a triangular pattern

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      public static void main(String[] args){
              JFrame frame=new JFrame("Java version 9");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              BufferedImage image =new BufferedImage(800,600,BufferedImage.TYPE_INT_RGB);
              Graphics2D g=image.createGraphics();
              g.setColor(Color.WHITE);
              for(int y=0;y<image.getHeight();y+=2){
                  g.drawLine(0,y,image.getWidth(),y);
              }
              g.dispose();
              ImageIcon imageIcon=new ImageIcon(image);
              JLabel label=new JLabel(imageIcon);
              frame.add(label);
              frame.pack();
              frame.setVisible(true);
          }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Don't upgrade to Java 9

      1. JavaHiDPI.java
        1.0 kB
        Pardeep Sharma
      1. 9vs8u144.png
        35 kB

        Activity

        webbuggrp Webbug Group created issue -
        pardesha Pardeep Sharma made changes -
        Field Original Value New Value
        Assignee Pardeep Sharma [ pardesha ]
        pardesha Pardeep Sharma made changes -
        Status New [ 10000 ] Open [ 1 ]
        pardesha Pardeep Sharma made changes -
        Labels regression webbug dcspks regression reproducer-yes webbug
        pardesha Pardeep Sharma made changes -
        Attachment JavaHiDPI.java [ 73055 ]
        Attachment 9vs8u144.png [ 73056 ]
        pardesha Pardeep Sharma made changes -
        Labels dcspks regression reproducer-yes webbug dcspks hidpi regression reproducer-yes webbug
        pardesha Pardeep Sharma made changes -
        Project Java Incidents [ 10301 ] JDK [ 10100 ]
        Key JI-9051185 JDK-8189416
        Workflow JBS Incident Workflow [ 4961038 ] JBS Workflow [ 4961038 ]
        Component/s client-libs [ 10307 ]
        Component/s client-libs [ 10700 ]
        Affects Version/s 9 [ 14949 ]
        Affects Version/s 9 [ 16400 ]
        pardesha Pardeep Sharma made changes -
        Subcomponent 2d [ 482 ] 2d [ 197 ]
        pardesha Pardeep Sharma made changes -
        Assignee Pardeep Sharma [ pardesha ]
        pardesha Pardeep Sharma made changes -
        Status Open [ 1 ] New [ 10000 ]
        vdyakov Victor Dyakov made changes -
        Fix Version/s 10 [ 16302 ]
        vdyakov Victor Dyakov made changes -
        Assignee Philip Race [ prr ]
        prr Philip Race made changes -
        Status New [ 10000 ] Open [ 1 ]
        prr Philip Race made changes -
        Summary Java SDK 9 hidpi rescaling Image scaling is bad with D3D pipeline
        prr Philip Race made changes -
        Assignee Philip Race [ prr ] Prahalad Kumar Narayanan [ pnarayanan ]
        psrivastava Praveen Srivastava made changes -
        Labels dcspks hidpi regression reproducer-yes webbug dcspks hidpi regression reproducer-yes sn_5 webbug
        pnarayanan Prahalad Kumar Narayanan made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        pardesha Pardeep Sharma made changes -
        Introduced In Version 9 [ 14949 ]
        pardesha Pardeep Sharma made changes -
        Assignee Prahalad Kumar Narayanan [ pnarayanan ] Pardeep Sharma [ pardesha ]
        vdyakov Victor Dyakov made changes -
        Affects Version/s 10 [ 16302 ]
        pardesha Pardeep Sharma made changes -
        Assignee Pardeep Sharma [ pardesha ] Prahalad Kumar Narayanan [ pnarayanan ]
        psrivastava Praveen Srivastava made changes -
        Labels dcspks hidpi regression reproducer-yes sn_5 webbug dcspks hidpi regression reproducer-yes sn_5 sn_6 webbug
        pnarayanan Prahalad Kumar Narayanan made changes -
        Fix Version/s 11 [ 18723 ]
        Fix Version/s 10 [ 16302 ]
        psrivastava Praveen Srivastava made changes -
        Labels dcspks hidpi regression reproducer-yes sn_5 sn_6 webbug dcspks hidpi regression reproducer-yes sn_5 sn_6 sn_7 webbug
        pnarayanan Prahalad Kumar Narayanan made changes -
        Status In Progress [ 3 ] Open [ 1 ]
        Understanding Cause Known [ 10000 ]
        pnarayanan Prahalad Kumar Narayanan made changes -
        Labels dcspks hidpi regression reproducer-yes sn_5 sn_6 sn_7 webbug dcspks hidpi regression reproducer-yes sn_5 sn_6 webbug
        pnarayanan Prahalad Kumar Narayanan made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Understanding Cause Known [ 10000 ]
        Resolution Won't Fix [ 2 ]
        pnarayanan Prahalad Kumar Narayanan made changes -
        Fix Version/s 11 [ 18723 ]
        pnarayanan Prahalad Kumar Narayanan made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        serb Sergey Bylokhov made changes -
        Resolution Won't Fix [ 2 ]
        Status Closed [ 6 ] Open [ 1 ]
        vdyakov Victor Dyakov made changes -
        Fix Version/s 11 [ 18723 ]
        vdyakov Victor Dyakov made changes -
        Assignee Prahalad Kumar Narayanan [ pnarayanan ] Jayathirth D V [ jdv ]
        jdv Jayathirth D V made changes -
        Status Open [ 1 ] In Progress [ 3 ]

          People

          • Assignee:
            jdv Jayathirth D V
            Reporter:
            webbuggrp Webbug Group
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated: