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

Christos Sotiriou <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <CANp+zOFbYDGpFUS1hLjORMn3oa0duV7cMheNBKBPaoxXd-H_1w@mail.gmail.com>
On 18 March 2012 17:46, Chris Wilson <[email protected]> wrote:

> On Sun, 18 Mar 2012 17:37:06 +0200, Christos Sotiriou <[email protected]>
> wrote:
> > 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.
>
> My first suspicion is that you may simply be expecting too much. The
> fastest hardware I have can only render 2M 10x10 rectangles per second.
> Having said that, there are likely many tricks we can show you to improve
> your drawing performance, mostly to make you aware of exactly what you
> are asking to be drawn and to then simplify those operations until they
> match hardware capabilities.
>

Dear Chris, Dear Dov,

thanks again for your replies.

I have thought through my current approach carefully, and have concluded
that its weakness lies in the fact that I am drawing > 100K objects "live",
*i.e. *whenever the window is exposed or the user zooms in/out, I use cairo
to draw the double buffer image, then I copy it over to the GtkLayout
window.

I believe it would be easier to create an cairo image surface at the
maximum required resolution, and then simply scale/pan that appropriately.

Thanks,

Christos.

-- 
--------------------------------------------------------------------------
Christos P. Sotiriou
email: [email protected]
Cell: +30 697 8984 222

--
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.