[cairo] Cairo and animations

Pietro Incardona asmprog32 at hotmail.com
Wed Dec 24 10:12:45 PST 2008


(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


More information about the cairo mailing list