[cairo] Performance problem with cairo / glitz

Stefan Krause Stefan.Krause at gmx.at
Sat Oct 2 09:01:09 PDT 2004


Dear all,

I just wanted to write a quick benchmark to see how qt4 preview, java2d 
and cairo with glitz are comparing. I didn't want to spent too much 
valuable time on this, so I went for a simple scenario: A background 
bitmap, a alpha blended gradient rectangle on a part of the bitmap and 
two lines of simple text in front of the rectangle. Then the time is 
measured to render 100 frames when zooming into the region where the 
rectangle with the text is.

I'm having two problems: First is that in the animation the font zooming 
appears rather jerky possibly due to rounding issues (maybe even because 
of hinting, but I don't know for sure). If you have any advice on how to 
make the zooming smoother please let me know.

The second problem is that cairo is rather slow when rendering to a 
drawable X11 (I'm rendering to an image and then showing this surface 
via cairo_show_surface). I thought that glitz should perform much better 
than the software rendering path, but surprisingly it doesn't - it's 
even slower than the first approach. This is why ask for your help: I 
guess I'm doing something wrong or very suboptimal in my code. You can 
find the sources, with a sample image and a Makefile (sorry, I'm too 
stupid for autotools) for this unimpressive little benchmark on 
http://home.arcor.de/krausest/temp/glitzTest.tar.bz2 
<http://home.arcor.de/krausest/temp/glitzTest.tar.bz2>
The two files are cairo2dDemo.cpp and glitz2dDemo.cpp both rendering the 
benchmark.I'm looking forward to any suggestions on how to improve it. 
<http://home.arcor.de/krausest/temp/glitzTest.tar.bz2>

I'm using a current cvs build from glitz (glx) and cairo. The nvidia X11 
driver shows correct OpenGL acceleration in other applications.

Thanks for your help,
Stefan Krause



More information about the cairo mailing list