1 /*
2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
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 /**
25 * @test
26 * @bug 4873505 6588884
27 * @author cheth
28 * @summary verifies that drawImage behaves the bounds of a complex
29 * clip shape. This was a problem with our GDI renderer on Windows, where
30 * we would ignore the window insets.
31 * @run main InsetClipping
32 */
33
34 /**
35 * This test works by setting up a clip area that equals the visible area
36 * of the Frame. When we perform any rendering operation to that window,
37 * we should not see the results of the operation because they should be
38 * clipped out. We create an Image with one color (red) and use a
39 * different background fill color (blue). We fill the area with the
40 * background color, then set the clip, then draw the image; if we detect
41 * the image color at pixel (0, 0) then we did not clip correctly and the
42 * test fails.
43 */
44
45 import java.awt.*;
|
1 /*
2 * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
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 /**
25 * @test
26 * @key headful
27 * @bug 4873505 6588884
28 * @author cheth
29 * @summary verifies that drawImage behaves the bounds of a complex
30 * clip shape. This was a problem with our GDI renderer on Windows, where
31 * we would ignore the window insets.
32 * @run main InsetClipping
33 */
34
35 /**
36 * This test works by setting up a clip area that equals the visible area
37 * of the Frame. When we perform any rendering operation to that window,
38 * we should not see the results of the operation because they should be
39 * clipped out. We create an Image with one color (red) and use a
40 * different background fill color (blue). We fill the area with the
41 * background color, then set the clip, then draw the image; if we detect
42 * the image color at pixel (0, 0) then we did not clip correctly and the
43 * test fails.
44 */
45
46 import java.awt.*;
|