[cairo] CAIRO_FORMAT_A8 / stride

Owen Taylor otaylor at redhat.com
Sun Jul 2 10:26:57 PDT 2006


On Sun, 2006-07-02 at 20:07 +0000, Nikolaj Thygesen wrote:
>     The thing is that I'm using an existing buffer for the data part, so I 
> don't always know whether stride is divisible by four, and the size of the 
> buffers may be substantial, so I'd hate to create temporary copies.
>     Suppose I created my own "local_image_surface" by cloning the official  
> "cairo_image_surface.c", and implemented what I need. Would other parts of 
> Cairo still readjust my "odd" stride, or could I get away with it?? I have 
> looked around at the Cairo sources but find very few references to stride.

I don't quite understand what your problem is ... as far as I know,
Cairo will work fine with non-word-aligned rowstrides, though it
may be less efficient.

Do you have a example where cairo_image_surface_create_for_data()
doesn't work in that case?

(If there are problems they are in the underlying pixman library not
cairo_image_surface.c)

I suspect you'd be surprised by how little overhead copying the data
would be .. memcpy is *fast* on modern machines, but I'd expect things
to just work.
						Owen

-------------- 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/20060702/e6008244/attachment.pgp


More information about the cairo mailing list