[cairo] 1.6: a8-mask: Making non-aligned strides illegal

Carl Worth cworth at cworth.org
Sun Jan 27 21:35:42 PST 2008


On Thu, 24 Jan 2008 12:43:35 -0800, Carl Worth wrote:
> 	• Fix a8mask failure	cworth

In talking with Keith, Eric, and Søren I've become convinced that
instead of "supporting" rendering to/from an A8 mask with a
non-multiple-of-4 stride value, we really do want to just document
this as illegal.

Forcing this kind of alignment will allow for many more optimization
opportunities.

The inkscape folks had run into this problem and I had said we'd have
a fix in 1.6. Instead, I'd like to volunteer to help fix the inkscape
code to allocate buffers with a properly aligned stride. If some kind
inkscape developer were willing to help me with this soon, that would
be great.

In order to make it easier to know what a "legal" stride is, (and to
allow us to require more stringent alignment constraints in the
future), I'm proposing the following new API:

	int
	cairo_image_surface_stride_for_width (cairo_format_t    format,
	                                      int               width);

And also documenting cairo_image_surface_create_for_data that the
stride value passed to it should always come from calling the function
above.

More details, (and more thorough documentation), in the patches below.

I'll push unless there are complaints.

-Carl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Rename-cairo_format_width-to-cairo_format_bits_per_p.patch
Type: application/octet-stream
Size: 0 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080127/ba55479d/attachment-0002.obj 


More information about the cairo mailing list