[cairo] Images with stride == width?

Behdad Esfahbod behdad at behdad.org
Tue Feb 10 20:12:17 PST 2009


Soeren Sandmann wrote:
> Soeren Sandmann <sandmann at daimi.au.dk> writes:
> 
>> It would probably have been better then to have a 
>>
>>         cairo_stride_is_valid()
>>
>> but ultimately, applications will want to know ahead of time whether
>> their existing stride is guaranteed to work or not.
>>
>> The restriction to multiples of 4 ultimately comes from pixman which
>> currently only deals with strides in numbers of uint32, and I don't
>> have any plans to change that to sizeof(int).
>>
>> But sizeof(int) is fine with me too, as long as we don't ever expect
>> to support 16 bit computers.
> 
> I pushed this keeping "multiple of 4". I couldn't bring myself to say
> sizeof(int) when that's only true on systems where sizeof(int) happens
> to be 4.

Well, the problem I was trying to optimize was not committing to something we
don't have to.  If all architectures we care about have a sizeof(int)
divisible by 4, then by documenting sizeof(int) we leave it open to change the
requirement in the future, whereas documenting as 4 will lock this
implementation detail down forever.

No biggy though.


behdad

> Soren
> 


More information about the cairo mailing list