[OpenJDK Rasterizer] Task 2 - line widening

Jim Graham Jim.A.Graham at Sun.COM
Wed May 16 11:46:57 PDT 2007


Francis Kung wrote:
> I remember reading at some point that it is mathematically impossible to 
> derive a bezier curve parallel to another bezier curve, so it has to 
> approximate somewhere... I assume that the preferred behaviour would be 
> to produce an approximated curve, rather than flattening, though.

That is likely true, but it is also mathematically impossible to derive 
a set of straight lines that are exactly parallel to a bezier curve as 
well, so both techniques are producing approximations.

Would you rather approximate a parallel bezier with lines that vary from 
the true curve by no more than epsilon or with a bezier that varies from 
the desired curve by no more than epsilon?

The advantage of curves in the widened path is that there are fewer 
segments to pass on to the final renderer.  If anyone were to call 
BS.createStrokedShape and then stroke the widened outline, it is also 
prettier, but the performance advantage in reducing the number of 
segments for rendering when it is invoked internally as part of a 
rendering operation is probably the more important benefit...

			...jim



More information about the graphics-rasterizer-dev mailing list