Cairo in GTK
Cairo surfaces in GTK can have a limited lifetime. This can lead to unexpected problems when drawing.
More specifically, the drawable surface used in an expose event is used for double buffering and is discarded at the end of the event. This means that the target of any Cairo context created using the drawable from an expose event will become invalid after the end of the event and cannot be used across multiple events.
To avoid problems,
gdk_cairo_create (for gtk) or create_cairo_context (for gtkmm 2.10+) must be used on every expose event.
This information was obtained from this newsgroup thread
Cairo is a vector graphics library designed to provide high-quality display and print output.