[OpenJDK 2D-Dev] [OpenJDK Rasterizer] Path2d needRoom very slow for huge paths

Laurent Bourgès bourges.laurent at gmail.com
Tue Apr 14 15:16:30 UTC 2015


Sorry I forgot mailing lists in CC !

Hi Jim,

Did you start looking at early rejection of segments (clipping) ?

On my side, I looked at the Stroker class and I figured out why it
generates so many segments (4M) for my 800k spiral: mitter join are
generated with many intermediate segments.

I wrote the StrokerTest class to illustrate this issue : it uses the
createStrokedShape() to illustrate / check what the renderer does
(stroking, dashing, culling).
Here is the ductus / pisces output with cap = CAP_BUTT (no extra cap
decoration) and join = MITTER_JOIN: you can see mitter joins are made with
several segments: 2 extra segment per join.


I started understanding and hacking the drawJoin() method = some quick &
dirty hacks to remove the intermediate point and use the intersection point
instead.

- Marlin without collinear Simplifier:



- Marlin with collinear Simplifier: it removes collinear segments:


To conclude, it is promising (many tests with curves remain) but I would
prefer avoiding generating such extra segments in the Stroker / Dasher as
early as possible ... but it seems more tricky !

PS: Cap decoration have the same issue: it generates 3 extra segments for
CAP_SQUARE, but the collinear simplifier eliminate superfluous segments.


Does anybody have any idea / opinion ?

Is there any reason to generate these intermediate segments (winding rule,
...) as ductus / pisces does ?

Does it seem possible to remove them definitely for the marlin renderer at
least ?


Cheers,
Laurent
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150414/9ce682dd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StrokerTest-DuctusRenderingEngine_norm-subpix_cap_0_join_0.png
Type: image/png
Size: 12444 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150414/9ce682dd/StrokerTest-DuctusRenderingEngine_norm-subpix_cap_0_join_0.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StrokerTest-MarlinRenderingEngine_norm-subpix_cap_0_join_0_simplifier_true.png
Type: image/png
Size: 8288 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150414/9ce682dd/StrokerTest-MarlinRenderingEngine_norm-subpix_cap_0_join_0_simplifier_true.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: StrokerTest-MarlinRenderingEngine_norm-subpix_cap_0_join_0_simplifier_false.png
Type: image/png
Size: 8612 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20150414/9ce682dd/StrokerTest-MarlinRenderingEngine_norm-subpix_cap_0_join_0_simplifier_false.png>


More information about the 2d-dev mailing list