[cairo] cairo and gdk/X11

Dan Amelang daniel.amelang at gmail.com
Wed Jun 6 19:56:40 PDT 2007

On 6/6/07, Tamas K Papp <tpapp at princeton.edu> wrote:
> Hi,

Hello Tamas,

> I have looked at the Cairo tutorial code and saw that it works by
> calling the draw function to redraw everything whenever required (if
> the window is resized/exposed etc).  Is there a way to avoid this, eg
> by making Cairo remember the draw operations and replay them when
> needed?

Nope. Cairo is a an immediate-mode graphics library; it has no
remebrance of drawings past.

If rerendering the whole scene is costly, it is best to use the
"damaged" area of the screen (you get this from the expose event) to
determine what needs to be redrawn, so you can skip the rest.
cairo_clip is a handy way to tell cairo not to bother rendering
anything outside a particular region, although it's best if you just
don't bother issuing unecessary drawing calls.

Hope that helps,


More information about the cairo mailing list