[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] [PATCH FOR REVIEW] Fix for bug where long dashed lines can make graphics go black.
From:       dlila () redhat ! com (Denis Lila)
Date:       2010-06-16 20:17:54
Message-ID: 1591506393.296881276719474271.JavaMail.root () zmail04 ! collab ! prod ! int ! phx2 ! redhat ! com
[Download RAW message or body]

The reproducer is: https://bugzilla.redhat.com/attachment.cgi?id=417597

I have attached a JTreg test version of it.

----- Original Message -----
From: "Andrew John Hughes" <ahughes at redhat.com>
To: "Denis Lila" <dlila at redhat.com>
Cc: 2d-dev at openjdk.java.net
Sent: Wednesday, June 16, 2010 11:18:42 AM GMT -05:00 US/Canada Eastern
Subject: [PATCH FOR REVIEW] Fix for bug where long dashed lines can make  graphics go black.

On 9 June 2010 23:49, Denis Lila <dlila at redhat.com> wrote:
> Hello.
>
> I think I have a fix for this bug:
> https://bugzilla.redhat.com/show_bug.cgi?id=597227
>
> The bug was caused by a few integer overflows in sun/java2d/pisces/Dasher.java
> and sun/java2d/pisces/Stroker.java which would cause the whole container to
> fill up with whatever colour the line had. Dasher.java was prone to 2 overflows:
> one when computing the x and y coordinate lengths of the line at hand, and
> another which actually happened in PiscesMath.hypot(int,int). I fixed these
> two by turning the variables into longs and using PiscesMath.hypot(long,long).
>
> Stroker.java was only prone to overflows when drawing end caps or when adding
> offsets to points. I fixed these by making sure lineTo and moveTo never moved
> too close to the boundaries set by Integer.MAX_VALUE and Integer.MIN_VALUE.
>
> I welcome any feedback.
>
> Thank you,
> Denis Lila.

Webrev against 2d: http://cr.openjdk.java.net/~andrew/rh597227/

Do you have a reproducer for this?  It would help if that was included
as a JTreg test.
-- 
Andrew :-)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DrawLine.java
Type: text/x-java
Size: 1650 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20100616/c487514d/attachment.bin 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20100616/c487514d/attachment.html 

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic