< prev index next >

src/demo/share/java2d/J2DBench/src/j2dbench/tests/ImageTests.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * --- 1,7 ---- /* ! * Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: *
*** 51,61 **** --- 51,63 ---- import java.awt.Image; import java.awt.Canvas; import java.awt.AlphaComposite; import java.awt.Dimension; import java.awt.GraphicsConfiguration; + import java.awt.Rectangle; import java.awt.RenderingHints; + import java.awt.Window; import java.awt.image.BufferedImage; import java.awt.image.BufferedImageOp; import java.awt.image.ByteLookupTable; import java.awt.image.ConvolveOp; import java.awt.image.DataBuffer;
*** 77,86 **** --- 79,90 ---- import javax.swing.JComponent; public abstract class ImageTests extends GraphicsTests { public static boolean hasVolatileImage; public static boolean hasTransparentVolatileImage; + public static boolean hasShapedWindow; + public static boolean hasOpacityWindow; public static boolean hasCompatImage; static { try { hasVolatileImage = (VolatileImage.class != null);
*** 94,103 **** --- 98,117 ---- try { new Canvas().getMousePosition(); hasTransparentVolatileImage = true; } catch (NoSuchMethodError e) { } + try { + new Window(null).setShape(new Rectangle()); + hasShapedWindow = true; + } catch (Exception e) { + } + try { + new Window(null).setOpacity(0.5f); + hasOpacityWindow = true; + } catch (Exception e) { + } } static Group imageroot; static Group.EnableSet imgsrcroot; static Group.EnableSet bufimgsrcroot;
< prev index next >