On Saturday 11 September 2010 15:31:10 Siarhei Siamashka wrote:
> +   else if (src >= (src << 8) && src >= (src << 16) && src >= (src << 24))
> +   {
> +  /* non-additive blending */

Sigh...

Somehow overlooked it, and the faster code path was actually not always taken 
when it could. This check should have been"if (src >= (src << 8) &&
(src | 0xFF0000) >= (src << 16) && src >= (src << 24))".

This can be verified by the following test program:
/**********/
#include <assert.h>
#include <stdint.h>

int main()
{
    uint32_t src;
    for (src = 0; src < 0xFFFFFFFF; src++)
    {
        int check1 = (src >= (src << 8) && (src | 0xFF0000) >= (src << 16) &&
                      src >= (src << 24));
        int check2 = ((src & 0xFF000000) >= ((src <<  8) & 0xFF000000) &&
                      (src & 0xFF000000) >= ((src << 16) & 0xFF000000) &&
                      (src & 0xFF000000) >= ((src << 24) & 0xFF000000));
        assert (check1 == check2);
    }
    return 0;
}
/**********/

-- 
Best regards,
Siarhei Siamashka

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Pixman mailing list
Pixman@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pixman

Reply via email to