8042098: Test sun/java2d/AcceleratedXORModeTest.java fails on Windows
authorprr
Fri, 20 Jun 2014 12:37:08 -0700
changeset 25204 65c62411e10f
parent 25203 ea684628f900
child 25205 e07f924ea72d
8042098: Test sun/java2d/AcceleratedXORModeTest.java fails on Windows Reviewed-by: jgodinez
jdk/test/sun/java2d/AcceleratedXORModeTest.java
--- a/jdk/test/sun/java2d/AcceleratedXORModeTest.java	Fri Jun 20 16:48:30 2014 +0400
+++ b/jdk/test/sun/java2d/AcceleratedXORModeTest.java	Fri Jun 20 12:37:08 2014 -0700
@@ -23,7 +23,7 @@
 
 /*
 * @test
-* @bug     8024343
+* @bug     8024343 8042098
 * @summary Test verifies that accelerated pipelines
 *          correctly draws primitives in XOR mode.
 * @run main/othervm -Dsun.java2d.xrender=True AcceleratedXORModeTest
@@ -128,6 +128,7 @@
 
     void test() {
         createVImg();
+        BufferedImage bi = null;
         do {
             int valCode = vImg.validate(getDefaultGC());
             if (valCode == VolatileImage.IMAGE_INCOMPATIBLE) {
@@ -135,9 +136,11 @@
             }
             Graphics2D g = vImg.createGraphics();
             draw(g);
-            BufferedImage bi = vImg.getSnapshot();
+            bi = vImg.getSnapshot();
+        } while (vImg.contentsLost());
+        if (bi != null) {
             test(bi);
             write(bi);
-        } while (vImg.contentsLost());
+        }
     }
 }