Slow performance of libart routines in gnomecanvas



Hello,
I have been working on developing a custom gnome canvas item to display
audio waveforms.  I am using an anti-aliased canvas, so I am using the
libart routines for waveform creation and rendering.  The waveform
widget is around 30 pixels high and potentially 1000s of pixels wide
(with only a portion shown at any given time).  The actual graphics are
extremely simple- vertical line segments between 0-30 pixels tall at
every x location.  During the update method I set up a vpath with a
series of MOVETO_OPEN and LINETO commands, sweeping from left end of the
waveform to the right.  I then affine_transform the vpath, then stroke
the vpath into a line (I don't understand why this is necessary?
Shouldn't I be able to render the svp from vpath directly?) , then call
gnome_canvas_item_update_svp_clip.  This works, and the waveform is
displayed nicely, but the update is expensive.  When I drag the waveform
around the canvas, it is extremely choppy.  I've determined that the
runtime hit is mainly caused by the stroke and the update_svp_clip()
routines.  The affine transform and the render to GnomeCanvasBuf are
fast.  Am I doing anything wrong here?  Can I use another method for
rendering onto a pixbuf?  Perhaps create a pixmap and use simple
gdk_draw methods, then copy the pixmap onto the pixbuf for render?

Thanks for any help,
Jason



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]