[cairo] XShm

Vladimir Vukicevic vladimir at pobox.com
Fri Oct 19 13:30:43 PDT 2007


Chris Wilson wrote:
> cairo_surface_as_image() is quite appealing (at least for the pixel
> based surfaces), but one quickly runs into complexities synchronizing
> the pixels between the image and the Xserver.
> 
> Perhaps something akin to push_group/pop_group:
>     cairo_acquire_image (cr); /* wraps acquire_dest_image() & redirection */
>     /* get pixel data for direct manipulation */
>     bits = cairo_image_surface_get_data (cairo_get_target (cr));
>     /* ... */
>     cairo_release_image (cr); /* release_dest_image() & restore */

Yup, that would work as well, though I think it should be 
cairo_surface_acquire_image (surface), not cairo_acquire_image.

> This would be for surfaces like win32 virtually a no-op and hit the XShm
> path for xlib.
> 
> Vlad, could you give some insight as to how
> cairo_win32_surface_get_image() is used by applications?

Basically for fast loading of images, to avoid the copy from image 
surface -> win32 DIB.

     - Vlad


More information about the cairo mailing list