[Xcb] util/image and xcb_image_put() sub-regions

Ian Osgood iano at quirkster.com
Thu Oct 19 10:58:15 PDT 2006

This is regarding recent changes to cairo to use src image sub- 
regions to optimize use of XPutImage in the Xlib backend. I was  
checking to see whether this was the right time to swap in the xcb- 
image library in order to support the same optimization for XCB.

Is it just me, or is xcb_image_put() completely missing support for  
source image sub regions?

 From what I can tell, the vast tracts of code under libX11/src/ 
PutImage.c:PutSubImage() have been replaced in xcb_image_put() with a  
call to the core protocol xcb_put_image(). This bypasses:
* Converting between src and dest bytes_per_line (NoSwap)
* byteswapping of source image byte/bit order to server byte/bit  
order (SwapFourBytes, SwapThreeBytes, SwapTwoBytes, SwapNibbles)
* extraction of the source region into a smaller chunk of data  
* differences between ZPixmap, XYPixmap, and Bitmap formats  
(PutImageRequest, SendXYImage vs. SendZImage)
* splitting the image to fit the max request size (PutSubImage)

As it stands, xcb_image_put only works for sending full ZPixmap  
images (x_offset==y_offset==0, width==image->width) to a server  
having the same xcb_setup parameters as the client.

For now, I'm going to code the sub-region logic directly into cairo,  
but we should also continue porting PutImage.c to xcb_image.c.


More information about the Xcb mailing list