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