[cairo] Pixmap double buffering in Xlib backend

Keith Packard keithp at keithp.com
Fri Jul 8 12:34:49 PDT 2005


The classic double buffering mechanism in X uses a pixmap to hold the
window contents. When the window is resized, the pixmap is destroyed and
a new one created in the new size.

With the old cairo_set_target_surface call, this was easily replicated
with cairo; when the window size changed, the old pixmap would be
destroyed and a new one created and stuffed into any associated cairo_t
objects.

Without this call, the code needs to create a new cairo_t object for the
new pixmap surface.

However, I cannot figure out how to extract all of the relevant state
(including saved gstates) from a cairo_t so that they can be loaded into
the new cairo_t so that the overlying code (which doesn't care that the
window has been resized) can continue drawing.

I see two solutions:

 1) Provide some cloning mechanism to move gstate information to the new
cairo_t.

 2) Add a cairo_xlib_set_drawable function so that the targetted
drawable can be changed at will. This is much more limited than the old
cairo_set_target_surface function as the backend and format of the
target surface cannot change, only the drawable itself.

-keith



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050708/fc38a023/attachment.pgp


More information about the cairo mailing list