[cairo] Rendering onto a larged tiled image surface?

Paul Messmer paulmessmer at hotmail.com
Sat Dec 1 20:05:48 PST 2007



I have an existing, potentially very large, image surface.  The surface isn't stored contiguously in memory.  Instead, the surface is broken up into rectangular tiles (e.g. 32x32 RGBA pixels, so a 320x320 image would be broken into 100 (10x10) tiles).  Tiles might not even all be in memory at once.

To draw onto this image surface, one needs to go through a level of indirection to gain access to tiles for reading or writing.  You can make a call requesting access to a particular tile.  You then receive a pointer to those (say 32x32) pixels, do whatever you need to them (read/write), and when finished make another call to release the tile.  You can access many tiles at once - e.g. enough to have access to an entire horizontal strip of tiles across the surface locked in memory at once - but you can't of course necessarily access the entire image at once.

I'm completely new to Cairo and just starting to evaluate the effort involved in using Cairo to draw into a surface like this.  This leads me to some questions:

Can Cairo deal with large surface dimensions, like 32k x 32k, 64k x 64k pixels, or beyond?

Is there some existing tiled surface functionality that I should be aware of, some work towards it?  If not, any speculation as to how much work there would be in supporting a tiled image surface with a level of indirection to tile access?  What should I look at first?

Thanks for any advice,
-- Paul



More information about the cairo mailing list