[cairo] Image surface pixel twiddling API

Mathias Hasselmann mathias.hasselmann at gmx.de
Mon Mar 5 22:11:32 PST 2007


Am Montag, den 05.03.2007, 20:08 -0500 schrieb Jeff Muizelaar:
> > We would like an API to obtain the particular channel of a pixel.  In 
> > our experiments we tried two different types of API.  The first was a 
> > set of macros that returned a particular channel from pixel word [1], 
> > the second were channel offset macros that could be used to index into a 
> > byte pointer.  For our use, the first approach of word accessors made 
> > for somewhat messier source code and generated code that was slightly 
> > slower for x86 though faster on PPC [3].
> 
> This is probably because x86 is better at byte addressing/operations.  If
> it's faster on PPC it will probably be faster on ARM which I imagine is a
> platform Mozilla will care about more in the future.

IMHO even such a minor platform like x86 ;-) should not get any
performance penalty in favour for exotic platforms like PowerPC or less
exotic platforms like ARM. Would it be possible to combine both
approaches using #ifdef mess?

Ciao,
Mathias



More information about the cairo mailing list