< prev index next >

test/jdk/java/awt/BasicStroke/DashOffset.java

Print this page

        

*** 27,36 **** --- 27,37 ---- import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.GraphicsEnvironment; import java.awt.Image; import java.awt.image.BufferedImage; + import java.awt.image.IndexColorModel; import java.awt.image.VolatileImage; import java.io.File; import java.io.IOException; import java.util.Arrays; import java.util.stream.Collectors;
*** 38,48 **** import static java.awt.image.BufferedImage.TYPE_INT_RGB; /* * @test ! * @bug 4469881 8217263 * @summary Verifies that dashed rectangles drawn to the screen line * up with their undashed counterparts * @author flar * @run main/othervm -Dsun.java2d.uiScale=1 DashOffset */ --- 39,49 ---- import static java.awt.image.BufferedImage.TYPE_INT_RGB; /* * @test ! * @bug 4469881 8217263 8218682 * @summary Verifies that dashed rectangles drawn to the screen line * up with their undashed counterparts * @author flar * @run main/othervm -Dsun.java2d.uiScale=1 DashOffset */
*** 87,96 **** --- 88,100 ---- try { final GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment() .getDefaultScreenDevice() .getDefaultConfiguration(); + if (gc.getColorModel() instanceof IndexColorModel) { + return; + } VolatileImage vi = gc.createCompatibleVolatileImage(WIDTH, HEIGHT); int attempt = 0; do { vi.validate(gc);
*** 100,110 **** if (attempt > 10) { throw new RuntimeException("Too many attempts: " + attempt); } validate(snapshot); } finally { ! if (saveImage) { save(snapshot, "volatileImage.png"); } } } --- 104,114 ---- if (attempt > 10) { throw new RuntimeException("Too many attempts: " + attempt); } validate(snapshot); } finally { ! if (saveImage && snapshot != null) { save(snapshot, "volatileImage.png"); } } }
< prev index next >