/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 6244574
@bug 6258142
@bug 6395165
@bug 6588884
@summary Tests that source is clipped correctly when blitting
different types of images to the screen
@author Dmitri.Trembovetski: area=Graphics2D
@run main SourceClippingBlitTest
*/
static private boolean showErrors;
private static volatile boolean done = false;
// allow user to override the properties if needed
}
showErrors = true;
}
try {
} catch (AWTException e) {
throw new RuntimeException(e);
}
f.addWindowListener(new WindowAdapter() {
public void windowActivated(WindowEvent e) {
if (!done) {
}
}
});
f.pack();
f.setVisible(true);
synchronized (lock) {
while (!done) {
try {
} catch (InterruptedException ex) {
}
}
}
if (!showErrors) {
f.dispose();
}
}
}
}
}
public void runTests() {
new Image[] {
BufferedImage.TYPE_INT_RGB, true),
BufferedImage.TYPE_INT_RGB, false),
// commented out due to 6593406
// getBMImage(gc, IMAGEW, IMAGEH),
// getBufferedImage(gc, IMAGEW, IMAGEH,
// BufferedImage.TYPE_INT_ARGB, true),
// getBufferedImage(gc, IMAGEW, IMAGEH,
// BufferedImage.TYPE_INT_ARGB, false),
})
{
// wiggle the source and dest rectangles
try {
{
}
}
} finally {
synchronized (lock) {
done = true;
}
}
}
}
{
int w = getWidth();
int h = getHeight();
if (image instanceof VolatileImage) {
}
do {
}
}
null);
}
int w = getWidth();
int h = getHeight();
try {
} catch (InterruptedException ex) {}
Point p = getLocationOnScreen();
// calculate the destination rectangle
// we do implicit clipping of the destination surface
// by only checking pixels within its bounds
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
int rgb = 0;
if (newDstRect.contains(x, y)) {
} else {
}
throw new RuntimeException(msg1);
}
}
}
}
g.dispose();
// need to 'accelerate' the image
dstImage =
}
g = dstImage.getGraphics();
}
int w, int h)
{
return image;
}
int w, int h)
{
return image;
}
int w, int h, int type, boolean acceleratable)
{
if (!acceleratable) {
}
return image;
}
}