[cairo] Performance problem with cairo / glitz

Stefan Krause Stefan.Krause at gmx.at
Sun Oct 3 08:23:47 PDT 2004


I ran the test today again and the performance of both did improve (for 
some strange reason) from about 80 seconds to 21 seconds for cairo with 
x11 backend and 7 seconds for the glitz backend (- which still leaves 
room for improvements).

Still I'm interested in how to improve the performace. Currently I'm 
reselecting the font in every frame with cairo_select_font. I tried to 
improve by using cairo_current_font once and then setting the font with 
cairo_set_font each frame. But this crashed with more than one font. Any 
recommendations as for high performance font handling?

As for the jerky zooming of the fonts I'm still looking for advice.

Thanks,
Stefan



Stefan Krause wrote:

> 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
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
>
>




More information about the cairo mailing list