[cairo] Performance issue with get_text_extents

Robert Prückl rprueckl at gmail.com
Fri Mar 30 03:14:58 PDT 2012

Dear all,

I am using gtkmm win32 2.22.0-2. cairomm version 1.8.4 is included there.
I want to draw 16 filled circles in a Gtk::DrawingArea which change
their diameters over time. For the screen update I am using the
Glib::signal_timeout() signal which calls the paint method with a
frequency of 30Hz.
I am encountering a performance issue while doing this.
The paint method of the class which paints the circles always calls
Cairo::Context::get_text_extents (not explicitely of course, and there
is no text rendering included) and this call eats about 95% of the
processing time of the whole paint function.
I discovered this by using 'Very Sleepy'
(http://www.codersnotes.com/sleepy) with the debug build of the
On my laptop (dual core) one core is thereby working at 100% and there
is noticable stutter on the application screen.

Do you have an idea to get rid of that problem? Help is greatly appreciated!

More information about the cairo mailing list