[OpenJDK 2D-Dev] More incompatibilities
Jim Graham
Jim.A.Graham at Sun.COM
Tue Mar 3 20:11:57 UTC 2009
I think the shape iterators used in the other pipelines (which should be
visible as it was code that we wrote, even if it isn't used for Pisces)
took a more flexible approach, testing each segment for NaN and overflow
and ignoring individual segments until the shape became finite again.
This happens somewhere in the src/share/classes/sun/java2d/pipe classes...
...jim
Roman Kennke wrote:
> Hi again,
>
>> 3. NotANumberTest: Double.NaN isn't handled gracefully.
>
> The problem here is that the renderer in OpenJDK is originally written
> for ME and uses fixed point arithmetic. I can't think of a quick fix,
> because shapes are processed by iterating over them, this means, by the
> time we hit the NaN, we might already have processed (==rendered) some
> of the shape, but your test seems to suggest that you expect nothing to
> be rendered in this case. The specification doesn't say anything about
> this particular problem (at least I can't find anything). One solution
> would be to pre-check all the incoming shapes for NaN or other invalid
> values (infinity, etc) and not go into the iteration at all. But this
> seems like quite a big overhead to me. We could also make the
> floating->fixed conversion to throw an exception, that we would have to
> catch higher up in the call tree and rollback what has already been
> rendered (which doesn't seem easy either, because in the case of
> strokeTo() this lies outside of the pisces renderer).
>
> /Roman
More information about the 2d-dev
mailing list