<div dir="ltr"><font face="arial,helvetica,sans-serif">For software rendering I have found agg to be much faster than cairo (at least it was when I tested a few years back, things may have changed since then). <br><br>Also you may consider using my GtkViewerWidget for zooming and scrolling. There are examples including how to use it with both cairo and agg at:<br>
<br><a href="http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html">http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html</a><br><br>Regards,<br>Dov<br><br></font><br><div class="gmail_quote">
On Sun, Mar 18, 2012 at 17:37, Christos Sotiriou <span dir="ltr"><<a href="mailto:csotiriou@gmail.com">csotiriou@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello all, <br><br>I have a serious 2D drawing performance problem with
GTK+ and Cairo on a GTK+ linux app. I suspect that my implementation
does not use any Xlib or other 2D acceleration (is it supported by GTK/Cairo?).<br><br>I was wondering if you could help me.<br><br>My
GTK+ application is based around a main application window is used for
drawing a very large number of drawables (>100K) (mainly rectangles)
on a map, and should support both scrolling and zooming in and out.<br><br>I have implemented this main window as a scrolled window, i.e. GtkScrolledWindow (<a href="http://developer.gnome.org/gtk3/stable/GtkScrolledWindow.html" target="_blank">http://developer.gnome.org/gtk3/stable/ ... indow.html</a>), containing a GtkLayout (<a href="http://developer.gnome.org/gtk3/stable/GtkLayout.html" target="_blank">http://developer.gnome.org/gtk3/stable/GtkLayout.html</a>).<br>
<br>The
GtkLayout is drawn upon using the cairo context provided by function
gdk_cairo_create() on the GTK_LAYOUT()->bin_window. I hope this is
making sense.<br><br>My problem is that drawing is too, too slow when
drawing >100K rectangles. I have tried double buffering in two ways
(a) by using a cairo image surface, drawing upon it and then copying
the pattern to my drawing context, and (b) by using cairo's
surface_create_similar() function, which supposedly uses X.<br><br>I have found that drawing is simply toooooo slow, every which way. <br><br>What am I doing wrong? How can I use cairo's Xlib capability without explicitly creating an Xlib surface?<br>
<br>Any help is very much appreciated.<br><br>Christos.<br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>(<a href="mailto:email%3Acsotiriou@gmail.com" target="_blank">email:csotiriou@gmail.com</a>)<span class="HOEnZb"><font color="#888888"><br clear="all">
<br>-- <br>--------------------------------------------------------------------------<br>Christos P. Sotiriou<br>email: <a href="mailto:csotiriou@gmail.com" target="_blank">csotiriou@gmail.com</a><br>Cell: <a href="tel:%2B30%20697%208984%20222" value="+306978984222" target="_blank">+30 697 8984 222</a><br>
</font></span><br>--<br>
cairo mailing list<br>
<a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
<a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br></blockquote></div><br><div style id="divCleekiAttrib"></div></div>