23
24 import java.awt.Color;
25 import java.awt.Graphics2D;
26 import java.awt.GraphicsConfiguration;
27 import java.awt.GraphicsEnvironment;
28 import java.awt.Image;
29 import java.awt.Rectangle;
30 import java.awt.Shape;
31 import java.awt.geom.AffineTransform;
32 import java.awt.image.BufferedImage;
33 import java.awt.image.VolatileImage;
34 import java.io.File;
35 import java.io.IOException;
36
37 import javax.imageio.ImageIO;
38
39 import static java.awt.geom.Rectangle2D.Double;
40
41 /**
42 * @test
43 * @bug 8061831 8130400
44 * @summary Tests drawing volatile image to volatile image using different
45 * clips + xor mode. Results of the blit compatibleImage to
46 * compatibleImage is used for comparison.
47 */
48 public final class IncorrectClipXorModeSurface2Surface {
49
50 private static int[] SIZES = {2, 10, 100};
51 private static final Shape[] SHAPES = {
52 new Rectangle(0, 0, 0, 0),
53 new Rectangle(0, 0, 1, 1),
54 new Rectangle(0, 1, 1, 1),
55 new Rectangle(1, 0, 1, 1),
56 new Rectangle(1, 1, 1, 1),
57
58 new Double(0, 0, 0.5, 0.5),
59 new Double(0, 0.5, 0.5, 0.5),
60 new Double(0.5, 0, 0.5, 0.5),
61 new Double(0.5, 0.5, 0.5, 0.5),
62 new Double(0.25, 0.25, 0.5, 0.5),
|
23
24 import java.awt.Color;
25 import java.awt.Graphics2D;
26 import java.awt.GraphicsConfiguration;
27 import java.awt.GraphicsEnvironment;
28 import java.awt.Image;
29 import java.awt.Rectangle;
30 import java.awt.Shape;
31 import java.awt.geom.AffineTransform;
32 import java.awt.image.BufferedImage;
33 import java.awt.image.VolatileImage;
34 import java.io.File;
35 import java.io.IOException;
36
37 import javax.imageio.ImageIO;
38
39 import static java.awt.geom.Rectangle2D.Double;
40
41 /**
42 * @test
43 * @key headful
44 * @bug 8061831 8130400
45 * @summary Tests drawing volatile image to volatile image using different
46 * clips + xor mode. Results of the blit compatibleImage to
47 * compatibleImage is used for comparison.
48 */
49 public final class IncorrectClipXorModeSurface2Surface {
50
51 private static int[] SIZES = {2, 10, 100};
52 private static final Shape[] SHAPES = {
53 new Rectangle(0, 0, 0, 0),
54 new Rectangle(0, 0, 1, 1),
55 new Rectangle(0, 1, 1, 1),
56 new Rectangle(1, 0, 1, 1),
57 new Rectangle(1, 1, 1, 1),
58
59 new Double(0, 0, 0.5, 0.5),
60 new Double(0, 0.5, 0.5, 0.5),
61 new Double(0.5, 0, 0.5, 0.5),
62 new Double(0.5, 0.5, 0.5, 0.5),
63 new Double(0.25, 0.25, 0.5, 0.5),
|