[OpenJDK 2D-Dev] miter line join bug
Phil Race
Phil.Race at Sun.COM
Thu Feb 19 05:48:17 UTC 2009
Without verifying the proposed fix itself, the problem I see here is that
this test doesn't appear to be automated. See the one for the dashed line
bug for ideas on automation.
For the record: we require that tests be provided and automated if at
all feasible, or there
must be a justification why its not provided or feasible be provided.
Fixes which don't
provide this will be pended once this is noted.
Reviewers will likewise reject fixes that don't conform.
The reason for this requirement is that its then possible to test the
fix on all platforms with minimal effort.
A fix that isn't automated likely won't be tested and isn't worth much.
-phil.
Hiroshi Yamauchi wrote:
> Hi,
>
> Here's a miter bugfix, and a test.
>
> Thanks,
> Hiroshi
>
> ---- bug ----
> The miter line join decoration isn't rendered properly.
>
> ---- fix ----
> +++ jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java 2009-02-18
> 17:14:05.000000000 -0800
> @@ -245,6 +245,7 @@
> FloatToS15_16(coords[1]));
> break;
> case PathIterator.SEG_CLOSE:
> + lsink.lineJoin();
> lsink.close();
> break;
> default:
>
> ---- test ----
> public class JoinMiterTest {
> public static void main(String[] args) throws Exception {
> BufferedImage image = new BufferedImage(200, 200,
> BufferedImage.TYPE_INT_RGB);
> Graphics2D g = image.createGraphics();
> g.setPaint(Color.WHITE);
> g.fill(new Rectangle(image.getWidth(), image.getHeight()));
> g.translate(25, 100);
> g.setPaint(Color.BLACK);
> g.setStroke(new BasicStroke(20, BasicStroke.CAP_BUTT,
> BasicStroke.JOIN_MITER));
> g.draw(new Polygon(new int[] {0, 150, 0}, new int[] {75, 0, -75},
> 3));
> ImageIO.write(image, "PNG", new File(args[0]));
> }
> }
>
More information about the 2d-dev
mailing list