[cairo] XShm

Behdad Esfahbod behdad at behdad.org
Mon Oct 29 20:27:48 PDT 2007


On Fri, 2007-10-26 at 13:50 -0400, Chris Wilson wrote:

> Of note, it turns out that cairo_image_surface_create_similar() has
> one or two subtle flaws - the first being that no-one can agree on an
> appropriate name that does not cause confusion for the language
> bindings. The second is that it exposes the user to ugly
> synchronization problems when using it as a source for the xlib backend,
> i.e. if the user does not call XSync() or otherwise guarantee that they
> will not modify the data before the xserver has finished using it, then
> they will corrupt the output. In practise, the interface is still useful
> for zero-copy loading of image data, but breaks if reused (for example
> rendering each frame to the image buffer and then performing quick blits
> to the xlib surface).

Got to say Argh...

Should we stand back and have a look at the big picture again?  What is
the concrete problem we are trying to solve?  Loading JPG/PNG images?
If that's the case, given that we need some way to pass in original
image data to cairo for acceptable PDF embedding, maybe we can focus on
such API instead, and make it use XShm internally for the xlib
implementation.

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759





More information about the cairo mailing list