[cairo] Problems blending with different platforms

Some Guy teknosoul at gmail.com
Thu Dec 10 16:38:19 PST 2009


I am using Cairo 1.8.8 and Pixman .17.2 - I have some cross platform code
that runs on an x86-64 machine and a low powered LE 32-bit MIPS.  I was
using the image backend surface (ARGB) that was filled with opaque yellow
and blending an ARGB image on top of it with the OVER operator.

I found that if the alpha value of an image in the pixel is 0, but RGB data
is not, I would get the proper blending behavior on the x86 but the MIPS
would produce a destination pixel with 0 alpha.  I found that the combine
code being used was in pixman-combine32.c and eventually traced it to
combine_over_u .  I did a quick test and it ended up working.

I've attached my patch - it seems kind of hacky, but it was a quick fix for
what I needed.  The gist of it is to not do anything if the input alpha is 0
( ALPHA_8 (~s) returns 255) so I check for that and skip the
UN8x4_MUL_UN8_ADD_UN8x4 operation.

Anyway, please let me know if this is totally wrong, it appears to work for
me, but I've been wrong before :)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20091210/4da64423/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: combine_over_u.patch
Type: application/octet-stream
Size: 492 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20091210/4da64423/attachment.obj 

More information about the cairo mailing list