classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: More AWT updates


From: Eric Blake
Subject: Re: FYI: More AWT updates
Date: Thu, 21 Mar 2002 01:14:14 -0700

I hadn't been looking at libgcj much, but a comparison did highlight a
few bugs I had made in Polygon, which I have just patched.  But I'll be
doing that more often, once I can get the Classpath version to
stabilize.

Part of the problem with awt.geom is the stringent requirement of
java.awt.Shape that a point on a boundary is inside the shape only half
the time.  The code in gcj's Polygon was ignoring this fact, so it's
just as well that I rewrote algorithms from scratch (although some could
probably be made a bit more efficient).  Also, there were quite a few
rounding errors while converting to int, in both libgcj and in Classpath
(before I touched it), some missing algorithms I implemented, and other
things that were just plain wrong, like RectangularShape treating
non-rectangles incorrectly.  And I have been running comparisons against
JDK 1.4, trying to reverse engineer all the corner cases without
decompiling any code.  So all in all, this has been, and will continue
to be, a beneficial code review.

Tom Tromey wrote:
> 
> >>>>> "Eric" == Eric Blake <address@hidden> writes:
> 
> Eric> Here's the latest batch. I updated all the interfaces of
> Eric> java.awt, and in the process had to add methods to Polygon.  I
> Eric> think I got the algorithms in Polygon correct, but it was a bear
> Eric> to code because of Sun's definition (in the Shape interface) of
> Eric> included points!  Someone who is more fluent with computer
> Eric> graphics than me may want to check my work.
> 
> FYI, some of this stuff might be in libgcj too.  It might be
> worthwhile to take a quick look before writing new code.
> (I'm not any more confident that I got the algorithms right.  It's
> been a long, long time since I did any computer graphics, and I don't
> have my books any more.)

Confession time - I haven't even taken a computer graphics course, let
alone have any graphics books.  I'm going solely off the documentation
on the things easy enough to do from scratch (which is why I'm not
touching more advanced things like CubicCurve2D, until I find a good
reference source).

2002-03-21  Eric Blake  <address@hidden>

        * java/awt/Dimension.java: Update to 1.4.
        * java/awt/Point.java: Update to 1.4.
        * java/awt/Polygon.java (Polygon): Don't share array.
        (contains(double, double)): Use boolean instead of int.
        (getPathIterator): Fix bugs.
        * java/awt/Rectangle.java: Update to 1.4.
        * java/awt/geom/AffineTransform.java: Remove unused nested class.
        * java/awt/geom/Dimension2D.java: Update to 1.4.
        * java/awt/geom/FlatteningpathIterator.java: New file (stubbed).
        * java/awt/geom/Line2D.java: Update to 1.4.
        * java/awt/geom/Makefile.am (EXTRA_DIST) Added
        FlatteningPathIterator.java.
        * java/awt/geom/PathIterator.java: Improve Javadoc.
        * java/awt/geom/Point2D.java: Update to 1.4.
        * java/awt/geom/Rectangle2D.java: Update to 1.4.
        * java/awt/geom/RectangularShape.java: Update to 1.4.
-- 
This signature intentionally left boring.

Eric Blake             address@hidden
  BYU student, free software programmer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]