/*
* 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 4873505 6588884
* @author cheth
* @summary verifies that drawImage behaves the bounds of a complex
* clip shape. This was a problem with our GDI renderer on Windows, where
* we would ignore the window insets.
* @run main InsetClipping
*/
/**
* This test works by setting up a clip area that equals the visible area
* of the Frame. When we perform any rendering operation to that window,
* we should not see the results of the operation because they should be
* clipped out. We create an Image with one color (red) and use a
* different background fill color (blue). We fill the area with the
* background color, then set the clip, then draw the image; if we detect
* the image color at pixel (0, 0) then we did not clip correctly and the
* test fails.
*/
static boolean painted = false;
public InsetClipping() {
}
painted = true;
}
clipTest.setVisible(true);
while (!painted) {
try {
} catch (Exception e) {}
}
try {
} catch (InterruptedException ex) {}
try {
clientLoc.y,
clientLoc.x + 2,
clientLoc.y + 2));
try {
} catch (Exception e) {}
} else {
throw new Error("Failed: incorrect color in pixel (0, 0)");
}
} catch (Exception e) {
}
}
}