[cairo] CGContextFlush in the new quartz backend

Richard Hult richard at imendio.com
Mon Mar 5 08:15:55 PST 2007


I have looked into a bit why GTK+ on OSX is much slower with the new 
quartz backend than it was with the old one.

The reason seems to be the call to flush the graphics context whenever a 
surface is finished. This basically means "synchronously push my changes 
to the screen", which doesn't work well together with how GTK+ uses 
cairo. A typical GTK+ app can easily create and destroy 20 surfaces when 
exposed, like when first created or when moving the mouse across it, and 
this means a flush is called 20 times as well, creating a lot of flicker 
and you can actually see each widget being drawn to the screen one at a 

To me, it would make more sense to leave that part (flushing the 
context) to the user of the surface, in this case GTK+ and not have the 
cairo surface do it automatically. Would this cause problems for other 


Imendio AB, http://www.imendio.com/

More information about the cairo mailing list