jdk/test/sun/java2d/pipe/Test7027667.java
author dlila
Tue, 15 Mar 2011 15:15:10 -0400
changeset 8747 921c3e30e9d7
child 9462 93f5dd7ff69a
permissions -rw-r--r--
7027667: clipped aa rectangles are not drawn properly. Summary: Already fixed. This is just a regression test for it. Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8747
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     1
/*
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     2
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     4
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     7
 * published by the Free Software Foundation.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     8
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    13
 * accompanied this code).
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    14
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    18
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    21
 * questions.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    22
 */
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    23
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    24
/**
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    25
 * @test
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    26
 * @bug     7027667, 7023591
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    27
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    28
 * @summary Verifies that aa clipped rectangles are drawn, not filled.
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    29
 *
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    30
 * @run     main Test7027667
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    31
 */
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    32
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    33
import java.awt.*;
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    34
import java.awt.geom.*;
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    35
import java.awt.image.*;
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    36
import static java.awt.RenderingHints.*;
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    37
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    38
public class Test7027667 {
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    39
    public static void main(String[] args) throws Exception {
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    40
        BufferedImage bImg = new BufferedImage(512, 512, BufferedImage.TYPE_INT_RGB);
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    41
        Graphics2D g2d = (Graphics2D) bImg.getGraphics();
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    42
        g2d.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    43
        g2d.setClip(new Ellipse2D.Double(0, 0, 100, 100));
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    44
        g2d.drawRect(10, 10, 100, 100);
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    45
        if (new Color(bImg.getRGB(50, 50)).equals(Color.white)) {
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    46
            throw new Exception("Rectangle should be drawn, not filled");
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    47
        }
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    48
    }
921c3e30e9d7 7027667: clipped aa rectangles are not drawn properly.
dlila
parents:
diff changeset
    49
}