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

Chris Wilson <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
On Mon, 19 Mar 2012 12:43:31 +0200, Christos Sotiriou <[email protected]> wrote:
> 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.

If you can create a small benchmark for your current drawing routine,
i.e. extract out your GtkWidget put it into a window and add some
dummy/representation data, I am very interested in making sure that
the drivers are performing as well as can be expected.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
--
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.