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

Jim Graham james.graham at Oracle.com
Mon Dec 13 20:25:04 UTC 2010

On 12/13/2010 10:54 AM, Denis Lila wrote:
> Hi Jim.
>> With respect to finding a cubic root, currently you are doing that in
>> 2 dimensions, but what if we converted to 1 dimension?
>> Consider that the control polygon is "fairly linear".  What if we
>> rotated our perspective so that it was horizontal and then squashed it
>> flat?  Consider instead a 1 dimensional bezier with control values
>> of:
>> (where |mn| is the length of the m->n control polygon of the original
>> curve - sum of all segments from point m to point n)
>> 0.0, |01|, |02|, |03|
> I had thought of something like this but I was afraid that the loss of
> Curve.java:141-152 would hurt accuracy. I implemented this though, and
> testing shows that that's not a problem. This should also double the
> performance of the computation since we only run one cubic root finder,
> and that was the major bottleneck.
> I updated the webrev.


> Should I remove some no longer needed methods, like getTCloseTo?

If you are confident that we don't need them any more (has that one ever 
really ever been added?  I think it is still in this same webrev review 
cycle so it would be "adding a method that was never used", no?)

>> Solve that 1 dimensional bezier for v=(leaflen*polylen)/linelen...
> Don't you mean (targetLength - lenAtLastT) * polylen / leaflen?

I guess.  I lost track of the terms in the discussion.  What I meant was 
"the length of how far into this curve we need to go scaled by the 
difference between that curve's control polygon length and that curve's 
chord length".  The values you write seem to be those so I guess that's 
right, but I'd need to see it in situ to verify...


More information about the 2d-dev mailing list