Hi Falcure,

falcure <[EMAIL PROTECTED]> wrote on 10/15/2007 08:48:37 PM:

> I've been usin Batik to draw very simple map symbols (like spheres,
> rectangles and arrows), in a java Graphics2D.

> I've been using java2D and I didn't want to abandon this solution, so I 
am
> creating map symbols using a RootGraphicsNode, and calling the method 
paint.

>     node = builder.build(ctx, svgDoc).getRoot();
> 
> This parse is done once, and I use a pool of objects to the symbols. 
When I
> need to plot a symbol, I apply a transform
> 
>      node.setTransform(transform);
> 
> and call the method paint();
> 
>       node.paint(g2d);

   Well this does a whole bunch of extra work over a simple
call to g2d.fill(...).  It handles issues with clipping, rendering
hints, different composite modes, etc.  It's much more general and
you do pay a price for that.
 
> It works, but when showing lots of symbols, map operation (like pan and
> zoom) are slow. I used to paint it using GeneralPath in Java2D, and 
didn't
> have this performance problem.

  I'm guessing the biggest piece of
extra overhead you are facing is the implict clip caused by the root
of an SVG rendering tree.  You might see if performance changes
significantly if you set 'overflow="visible"' on the root SVG of
the document for each symbol.

Reply via email to