< prev index next >

test/java/awt/image/multiresolution/Corrupted2XImageTest.java

Print this page

        

*** 35,45 **** * @build ExtendedRobot * @run main Corrupted2XImageTest */ import java.awt.*; - import java.awt.geom.AffineTransform; import java.awt.image.*; import java.io.*; import javax.imageio.ImageIO; --- 35,44 ----
*** 114,140 **** throw new RuntimeException("test failed, color = " + c); } System.out.println("ok"); dispose(); } - private static boolean is2x() { - - AffineTransform tr = GraphicsEnvironment.getLocalGraphicsEnvironment(). - getDefaultScreenDevice().getDefaultConfiguration(). - getDefaultTransform(); - return Math.min(tr.getScaleX(), tr.getScaleY()) > 1.001; - } - public static void main(String[] args) throws Exception { - // TODO: update the test with sun.java2d.uiScale option (remove is2x()) - // after fix of JDK-8150844 enh. to run it on non-HiDPI machines as well - if (is2x()) { // formats supported by Toolkit.getImage() ! for (String format: new String[]{"gif", "jpg", "png"}) { (new Corrupted2XImageTest(format)).doTest(); } - } else { - System.out.println("this test is for HiDPI only"); - } } } --- 113,125 ---- throw new RuntimeException("test failed, color = " + c); } System.out.println("ok"); dispose(); } public static void main(String[] args) throws Exception { // formats supported by Toolkit.getImage() ! for (String format : new String[]{"gif", "jpg", "png"}) { (new Corrupted2XImageTest(format)).doTest(); } } }
< prev index next >