[OpenJDK Rasterizer] Task 2 - line widening

Francis Kung fkung at redhat.com
Wed May 16 12:25:07 PDT 2007


>> I remember reading at some point that it is mathematically impossible 
>> to derive a bezier curve parallel to another bezier curve
> 
> 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.
...
> 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...

Agreed - of the two approximation techniques, an approximated curve is 
better than flattening.  I'm guessing that the encumbered code you've 
seen mostly deals with finding a good way to create such a curve... and 
unfortunately Classpath went the route of flattening in this area.

Francis



More information about the graphics-rasterizer-dev mailing list