[cairo] RSVG slow cairo rendering

Louis Simons lsimons at SafeFlight.com
Fri Sep 20 08:54:08 PDT 2013

I'm pretty new to working with Cairo rendering, and apologize if this is the wrong forum.

I'm prototype an embedded display using wxPython, Cairo, RSVG, and Inkscape (to generate SVGs).  I've written a simple animator which lets me blink/fade/move etc. parts of the displayed image by adding transformer and css styles based on the SVG element's ID.  Unfortunately, when the component is drawn larger (for example, full-screen on a monitor vs. windowed in a form), the framerate decreases significantly.  I've profiled the code, and the slowdown is in the rsvg.Handle(data=svg_xml_data).render_cairo(context_to_render_to) call.

I had thought that since SVG is numerical paths rather than bitmap data, I wouldn't have a performance change based on the size of the display.  I did find a reference ( http://python.6.x6.nabble.com/Displaying-SVG-in-tkinter-using-cairo-and-rsvg-td1173198.html) mentioning that the render may slow down based on the pixel buffer size which makes sense.

Is there any suggested solution for avoiding this?  I'm wondering if it might be better to render the SVG at a fixed resolution, and then scale/interpolate in some other way.  It seems like there's not much information on RSVG.  I know this list is primarily Cairo discussion, but was wondering if anybody has another favorite tool for rendering SVG data via Cairo?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20130920/f1eaf7a9/attachment.html>

More information about the cairo mailing list