JDK-7027667 : Clipped AA rectangle rendering regression
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2011-03-15
  • Updated: 2012-03-20
  • Resolved: 2011-03-15
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :


A DESCRIPTION OF THE PROBLEM :
When one renders an antialiased rectangle with using a clip (a complex clip that doesn't get optimized away into a rectangle, like an Ellipse) the rectangle is filled instead of drawn.

REGRESSION.  Last worked in version 7

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Run the source.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception.
ACTUAL -
Exception.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
    public static void main(String[] args) throws Exception {
        BufferedImage bImg = new BufferedImage(512, 512, BufferedImage.TYPE_INT_RGB);
        Graphics2D g2d = (Graphics2D) bImg.getGraphics();
        g2d.setRenderingHint(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON);
        g2d.setClip(new Ellipse2D.Double(0, 0, 100, 100));
        g2d.drawRect(10, 10, 100, 100);
        if (new Color(bImg.getRGB(50, 50)).equals(Color.white)) {
            throw new Exception("Rectangle should be drawn, not filled");
        }
    }
---------- END SOURCE ----------