[OpenJDK 2D-Dev] X11 uniform scaled wide lines and dashed lines; STROKE_CONTROL in Pisces

Denis Lila dlila at redhat.com
Wed Dec 8 20:04:49 UTC 2010

> I'm not sure how the closed interval is awkward.  Isn't it just proper
> choice of ">= and <= vs. > and <" in the testing method?

In the filtering function, yes, but I was referring to cubicRootsInAB in
Helpers:122-133 where we iterate through intervals. For each interval,
we have the values of the function at the ends, and if the left one
is 0, we just add it as a zero and skip the call to CubicNewton. In order
to get roots in [A,B], we would either have to test both endpoints (which
would be more expensive and it would force us to find a way of avoiding
duplicate roots), or we would have to deal with the last interval as
a special case. The latter is not that bad, but it is more awkward than
what we have now.

> How about "if the 3 segments of the control polygon are all close to 
> each other in length and angle", then the optimization applies.  Is
> that easy to test?

Hmm, that would actually be extremely easy to test and it would cost almost
nothing. We already compute the control polygon lengths in onLeaf, and
we're already assuming that every leaf is "flat enough", so we probably
don't even need to check the angles. Comparing lengths should be good enough.
I'll try this out.

Thank you,

More information about the 2d-dev mailing list