Hi Thomas, I've profiled the application and around 50% of the spent time on drawing is used on the calls of the painters (CompositeShapePainter, StrokeShapePainter and FillShapePainter). Much of this time is used on Graphics2D.draw().
I've tested the BufferedImage approach and It's working very well. Since I don't need Dynamic or animated symbols, It looks fine. Thanks, Felipe Alcure thomas.deweese wrote: > > 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. > > -- View this message in context: http://www.nabble.com/Method-paint%28%29-in-RootGraphicsNode-with-low-performance---tuning-application-tf4631308.html#a13298288 Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
