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

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

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dashedLinesBlackWindowBugFix.patch
Type: text/x-patch
Size: 7068 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20100609/45fa7955/attachment.bin 

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

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