17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.AlphaComposite;
25 import java.awt.Color;
26 import java.awt.Graphics2D;
27 import java.awt.GraphicsConfiguration;
28 import java.awt.GraphicsEnvironment;
29 import java.awt.Image;
30 import java.awt.image.BufferedImage;
31 import java.awt.image.VolatileImage;
32
33 import static java.awt.Transparency.BITMASK;
34
35 /**
36 * @test
37 * @bug 7188942
38 * @summary We should get correct volatile image, when we use BITMASK
39 * transparency
40 */
41 public final class BitmaskVolatileImage {
42
43 public static final int S = 8;
44
45 public static void main(final String[] args) {
46 GraphicsConfiguration gc =
47 GraphicsEnvironment.getLocalGraphicsEnvironment()
48 .getDefaultScreenDevice().getDefaultConfiguration();
49 VolatileImage vi = gc.createCompatibleVolatileImage(S, S, BITMASK);
50 BufferedImage ci = gc.createCompatibleImage(S, S, BITMASK);
51
52 int attempt = 0;
53 do {
54 if (++attempt > 10) {
55 throw new RuntimeException("Too many attempts: " + attempt);
56 }
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.AlphaComposite;
25 import java.awt.Color;
26 import java.awt.Graphics2D;
27 import java.awt.GraphicsConfiguration;
28 import java.awt.GraphicsEnvironment;
29 import java.awt.Image;
30 import java.awt.image.BufferedImage;
31 import java.awt.image.VolatileImage;
32
33 import static java.awt.Transparency.BITMASK;
34
35 /**
36 * @test
37 * @key headful
38 * @bug 7188942
39 * @summary We should get correct volatile image, when we use BITMASK
40 * transparency
41 */
42 public final class BitmaskVolatileImage {
43
44 public static final int S = 8;
45
46 public static void main(final String[] args) {
47 GraphicsConfiguration gc =
48 GraphicsEnvironment.getLocalGraphicsEnvironment()
49 .getDefaultScreenDevice().getDefaultConfiguration();
50 VolatileImage vi = gc.createCompatibleVolatileImage(S, S, BITMASK);
51 BufferedImage ci = gc.createCompatibleImage(S, S, BITMASK);
52
53 int attempt = 0;
54 do {
55 if (++attempt > 10) {
56 throw new RuntimeException("Too many attempts: " + attempt);
57 }
|