[OpenJDK 2D-Dev] Question regarding filling shapes

Roman Kennke roman at kennke.org
Tue Oct 28 19:43:54 UTC 2008

Dear 2d-devs,

I want to implement a ShapeDrawPipe, and studying the X11Renderer
implementation I see that there seem to be two different approaches. One
is the (C-only) ProcessPath thingy (ProcessPath.h and ProcessPath.c),
the other is the ShapeSpanIterator, which is available both as Java and
as C API. In the X11Renderer we go into the ProcessPath in the
'sg2d.strokeState == sg2d.STROKE_THIN' case only, and otherwise the SSI
is used. The ProcessPath only uses drawLine(), drawPixel() and
drawScanline() operations, while the SSI produces rectangles for use in
a fillRect() operation. My questions:

- are the above observations correct? (Only want to be sure)
- what kind of a difference makes the strokeState for filling a shape? I
was under the impression that the stroke is only used when drawing
things. Or is that for the case when the fill() operation is actually
used as a 'backend' for another draw() operation?
- how does the performance of the ProcessPath compare to the SSI? Which
one should I use in my ShapeDrawPipe implementation? Or does it make
sense to use both, just like in the X11Renderer? And if so, then why?

Thanks for your answers in advance,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
URL: <http://mail.openjdk.java.net/pipermail/2d-dev/attachments/20081028/36d77b62/signature.asc>

More information about the 2d-dev mailing list