Mercurial > hg > release > icedtea6-1.5
changeset 1488:0cf247b95e6c
2009-04-29 Omair Majid <omajid@redhat.com>
* patches/icedtea-java2d-stroker-internal-close-joint.patch: New patch.
Fix extra line when stroking the final miter joint created by
GeneralPath.closePath().
* Makefile.am (ICEDTEA_PATCHES): Apply the above.
* HACKING: Document the above.
author | Omair Majid <omajid@redhat.com> |
---|---|
date | Wed, 29 Apr 2009 14:09:02 -0400 |
parents | 713678ee2064 |
children | d65e58dcaed5 |
files | ChangeLog HACKING Makefile.am patches/icedtea-java2d-stroker-internal-close-joint.patch |
diffstat | 4 files changed, 106 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Wed Apr 29 13:46:09 2009 -0400 +++ b/ChangeLog Wed Apr 29 14:09:02 2009 -0400 @@ -1,3 +1,11 @@ +2009-04-29 Omair Majid <omajid@redhat.com> + + * patches/icedtea-java2d-stroker-internal-close-joint.patch: New patch. + Fix extra line when stroking the final miter joint created by + GeneralPath.closePath(). + * Makefile.am (ICEDTEA_PATCHES): Apply the above. + * HACKING: Document the above. + 2009-04-29 Omair Majid <omajid@redhat.com> * patches/icedtea-java2d-stroker-internal-joint.patch: New patch. Fixes
--- a/HACKING Wed Apr 29 13:46:09 2009 -0400 +++ b/HACKING Wed Apr 29 14:09:02 2009 -0400 @@ -94,6 +94,7 @@ * icedtea-ignore-unrecognized-options.patch: Add -XX:+IgnoreUnrecognizedVMOptions flag to hotspot (S6788376). * icedtea-java2d-mitre-join.patch: Backport fix for mitre join decoration (S6812600). * icedtea-java2d-stroker-internal-joint.patch: Fix penultimate joint created by GeneralPath.closePath(). +* icedtea-java2d-stroker-internal-close-joint.patch: Fix final joint created by GeneralPath.closePath(). The following patches are only applied to OpenJDK6 in IcedTea6:
--- a/Makefile.am Wed Apr 29 13:46:09 2009 -0400 +++ b/Makefile.am Wed Apr 29 14:09:02 2009 -0400 @@ -679,6 +679,7 @@ patches/icedtea-dnd-filelists.patch \ patches/icedtea-java2d-mitre-join.patch \ patches/icedtea-java2d-stroker-internal-joint.patch \ + patches/icedtea-java2d-stroker-internal-close-joint.patch \ $(DISTRIBUTION_PATCHES) stamps/extract.stamp: stamps/download.stamp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/patches/icedtea-java2d-stroker-internal-close-joint.patch Wed Apr 29 14:09:02 2009 -0400 @@ -0,0 +1,96 @@ +--- openjdk/jdk/src/share/classes/sun/java2d/pisces/Stroker.java.orig 2009-04-29 14:01:43.000000000 -0400 ++++ openjdk/jdk/src/share/classes/sun/java2d/pisces/Stroker.java 2009-04-29 14:00:03.000000000 -0400 +@@ -633,7 +633,7 @@ + } + + emitLineTo(sx0 + mx0, sy0 + my0); +- emitLineTo(sx0 - mx0, sy0 - my0); // same as reverse[0], reverse[1] ++ emitMoveTo(sx0, sy0); // same as reverse[0], reverse[1] + + // Draw final join on the inside + if (ccw) { +--- /dev/null 2009-04-15 13:37:55.776002308 -0400 ++++ openjdk/jdk/test/sun/pisces/MiterInternalCloseJointTest.java 2009-04-29 13:59:31.000000000 -0400 +@@ -0,0 +1,82 @@ ++/* ++ * Copyright 2009 Red Hat, Inc. All Rights Reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * 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. ++ */ ++ ++/* ++ @test ++ @summary Check that the final joint created using ++ generalPath.closePath() is correct ++ @author Omair Majid <omajid@redhat.com> ++ @run main MiterInternalCloseJointTest ++ */ ++import java.awt.BasicStroke; ++import java.awt.Color; ++import java.awt.Graphics2D; ++import java.awt.geom.GeneralPath; ++import java.awt.image.BufferedImage; ++ ++public class MiterInternalCloseJointTest { ++ ++ static final int WIDTH = 200; ++ static final int HEIGHT = 200; ++ ++ static final int x0 = 50, y0 = 50; ++ static final int x1 = 150, y1 = 50; ++ static final int x2 = 100, y2 = 100; ++ ++ private static BufferedImage createTestImage() { ++ final BufferedImage image = new BufferedImage(WIDTH, HEIGHT, ++ BufferedImage.TYPE_INT_BGR); ++ Graphics2D g = image.createGraphics(); ++ ++ g.setColor(Color.BLACK); ++ g.fillRect(0, 0, WIDTH, HEIGHT); ++ ++ float wideStrokeWidth = 20.0f; ++ BasicStroke wideStroke = new BasicStroke(wideStrokeWidth, ++ BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, wideStrokeWidth); ++ float thinStrokeWidth = 3.0f; ++ BasicStroke thinStroke = new BasicStroke(thinStrokeWidth, ++ BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, thinStrokeWidth); ++ ++ g.setColor(Color.WHITE); ++ GeneralPath path = new GeneralPath(); ++ path.moveTo(x0, y0); ++ path.lineTo(x1, y1); ++ path.lineTo(x2, y2); ++ path.closePath(); ++ path.closePath(); ++ g.setStroke(thinStroke); ++ g.draw(wideStroke.createStrokedShape(path)); ++ ++ return image; ++ } ++ ++ public static void main(String[] args) { ++ ++ BufferedImage testImage = createTestImage(); ++ ++ int color = testImage.getRGB(x0,y0-5); ++ System.out.println("Color seen: #" + Integer.toHexString(color)); ++ if (color == Color.WHITE.getRGB()) { ++ throw new RuntimeException( ++ "Test Failed; did not expected to see a white line at the start of the path"); ++ } ++ ++ } ++}