[cairo] GTK+, Cairo, XLib integration for fast 2D graphics drawing

Chris Wilson chris at chris-wilson.co.uk
Sun Mar 18 08:46:24 PDT 2012

On Sun, 18 Mar 2012 17:37:06 +0200, Christos Sotiriou <csotiriou at gmail.com> 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.

Can you record a cairo-trace of your rendering, so that we can see what
you are doing (and so that I can check for any defects in my drivers)?

Also what hardware/drivers/X are you using?

Chris Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list