[cairo] Cairo and animations

M Joonas Pihlaja jpihlaja at cc.helsinki.fi
Mon Dec 22 14:11:40 PST 2008


Hi,

On Mon, 22 Dec 2008, Pietro Incardona wrote:

> For now I am not using my code, but your example code here
> http://www.cairographics.org/threaded_animation_with_cairo/
> I has downloaded ( and compiled ) the git cairo version

[snip]

> Started the example ./threaded_exampResult: 1 - 2 frame / sec

The threaded example code is very slow on purpose.  The point of 
the example is to show how to use threads to separate a slow 
rendering function from other parts of the application.

If you look at the drawing function of the example it'll become 
clear: to make the rendering slow the example renders a linear 
gradient in a silly way (a differently solid coloured stroke for 
each horizontal line of the gradient), and if that wasn't slow 
enough it repeats rendering the same gradient 100x per frame to 
make absolutely sure it crawls.  Simply removing the 100x looping 
makes it smooth for me.

Cheers,

Joonas



More information about the cairo mailing list