[cairo] Slow painting of images

Haakon Riiser haakon.riiser at fys.uio.no
Thu Oct 27 02:43:32 PDT 2005


[Evan Martin]

> Just a guess (I looked through the Cairo source and couldn't confirm
> it), but perhaps creating the xlib surface on every draw is expensive
> -- it seems if that were cheap there wouldn't be an API for resizing
> surfaces.  Other code I've seen that does similar things creates the
> surface when you create the window.

I just timed the win_draw() function using gettimeofday() and it
is clearly not to blame for this.  The entire thing finishes in
approximately 0.1 seconds, which is _far_ quicker than the actual
time elapsed while redrawing of the window.  It takes about five
seconds to paint a maximized window on my computer!  The CPU-time
is spent in the X server, so it appears that Cairo uses an extremely
inefficient way to paint the image, as if every single pixel were
painted individually.

-- 
 Haakon


More information about the cairo mailing list