8042098: Test sun/java2d/AcceleratedXORModeTest.java fails on Windows
Reviewed-by: jgodinez
--- 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());
+ }
}
}