[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Benchmarking XRenderComposite() at runtime?
From:       Olivier Fourdan <fourdan () xfce ! org>
Date:       2006-03-31 5:50:54
Message-ID: 442CC33E.3030601 () xfce ! org
[Download RAW message or body]


Hi all,

I'd like to test the speed of XRenderComposite() at runtime (to enable 
or disable the compositor automatically) so I wrote a function that 
measures the time it takes to perform a few XRenderComposite() calls.

Unfortunately, the results computed don't vary much between the 
accelerated NVidia driver and the Open Source "nv" driver although the 
compositor is hardly usable with transparency with the "nv" driver, so I 
must be missing something here.

Any idea how I could test the speed of the XRender implementation 
accurately?

Thanks in advance,
Cheers,
Olivier.

gboolean
compositorBenchmark (Display *dpy)
{
     Picture picture1, picture2;
     XRenderPictureAttributes pa;
     XRenderPictFormat *render_format;
     Pixmap pixmap;
     XRenderColor c;
     int i;

     c.alpha = 0x7fff;
     c.red   = 0x7fff;
     c.green = 0x7fff;
     c.blue  = 0x7fff;

     render_format = XRenderFindStandardFormat (dpy,
                                                PictStandardARGB32);

     pixmap = XCreatePixmap (dpy,
                             DefaultRootWindow(dpy),
                             100, 100, 32);
     pa.repeat = TRUE;
     picture1 = XRenderCreatePicture (dpy, pixmap,
                                     render_format, CPRepeat, &pa);
     picture2 = XRenderCreatePicture (dpy, pixmap,
                                     render_format, CPRepeat, &pa);
     XRenderFillRectangle (dpy, PictOpSrc,
                           picture1, &c, 0, 0, 100, 100);
     XRenderFillRectangle (dpy, PictOpSrc,
                           picture2, &c, 0, 0, 100, 100);
     XFreePixmap (dpy, pixmap);
     for (i = 0; i < 100; i++)
     {
         XRenderComposite (dpy, PictOpOver, picture1, picture2,
                           None, 0, 0, 0, 0, 0, 0, 100, 100);
         XSync (dpy, FALSE);
     }
     XRenderFreePicture (dpy, picture1);
     XRenderFreePicture (dpy, picture2);

     return TRUE;
}



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic