[cairo] Cairo and animations

Gerdus van Zyl gerdusvanzyl at gmail.com
Wed Dec 24 13:05:44 PST 2008


What is happening is the program is uploading a large bitmap to the
video card which is slow and bypassing any optimizations.  Have you
tried not rendering using threads to an ofscreen surface and instead
going single thread and drawing on expose?

~G

On Wed, Dec 24, 2008 at 8:12 PM, Pietro Incardona <asmprog32 at hotmail.com> wrote:
>
> (Sorry ................ damn Linux Opera )
>
> Doing some benchmarks the bottleneck is located here
>
>    struct timeb bbb1;
>    struct timeb bbb2;
>    double t = 0;
>    ftime(&bbb1);
>
>    cairo_t *cr_pixmap = gdk_cairo_create(pixmap);
>    cairo_set_source_surface (cr_pixmap, cst, 0, 0);
>    cairo_paint(cr_pixmap);
>    cairo_destroy(cr_pixmap);
>
>    ftime(&bbb2);
>    t = (bbb2.time - bbb1.time)  + (double)(bbb2.millitm - bbb1.millitm) / 1000.0;
>    printf("do_draw bench %f \n",t);
>
> need 1 sec to execute the code
>
> ----------------------------------------
>> Date: Wed, 24 Dec 2008 13:47:37 +0100
>> From: bonzini at gnu.org
>> To: asmprog32 at hotmail.com
>> CC: cairo at cairographics.org
>> Subject: Re: Cairo and animations
>>
>> Pietro Incardona wrote:
>>>
>>> This is the code ( it draw one rectangle but the result don' t change )
>>
>> I haven't looked at it, but probably the culprit is transferring the
>> window pixels to the screen. When using OpenGL, for example, I have
>> seen sometimes glTexImage2D taking more time than the rest of the drawing.
>>
>> Paolo
>
> _________________________________________________________________
> Fanne di tutti i colori, personalizza la tua Hotmail!
> http://imagine-windowslive.com/Hotmail/#0
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>


More information about the cairo mailing list