Re: GTK+, Cairo, XLib integration for fast 2D graphics drawing

Dov Grobgeld <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CA++fsGGogt7+w3Q17X16YVq3AXjXiX-H=x1tgYogEN9gF4omQQ@mail.gmail.com>
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).

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:

http://giv.sourceforge.net/gtk-image-viewer/gtkimageviewer_tutorial.html

Regards,
Dov


On Sun, Mar 18, 2012 at 17:37, Christos Sotiriou <[email protected]>wrote:

> Hello all,
>
> 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?).
>
> I was wondering if you could help me.
>
> 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.
>
> I have implemented this main window as a scrolled window, i.e.
> GtkScrolledWindow (http://developer.gnome.org/gtk3/stable/ ... indow.html<http://developer.gnome.org/gtk3/stable/GtkScrolledWindow.html>),
> containing a GtkLayout (
> http://developer.gnome.org/gtk3/stable/GtkLayout.html).
>
> 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.
>
> 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.
>
> I have found that drawing is simply toooooo slow, every which way.
>
> What am I doing wrong? How can I use cairo's Xlib capability without
> explicitly creating an Xlib surface?
>
> Any help is very much appreciated.
>
> Christos.
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> (email:[email protected])
>
> --
> --------------------------------------------------------------------------
> Christos P. Sotiriou
> email: [email protected]
> Cell: +30 697 8984 222
>
> --
> cairo mailing list
> [email protected]
> http://lists.cairographics.org/mailman/listinfo/cairo
>

--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.