Store the operator table more compactly.
authorSøren Sandmann Pedersen <sandmann@redhat.com>
Sat, 19 Sep 2009 06:32:28 +0000 (02:32 -0400)
committerSøren Sandmann Pedersen <ssp@redhat.com>
Sun, 14 Mar 2010 16:11:47 +0000 (12:11 -0400)
commit58be9c71d2b1d0ed9d8feed1db0581b250d0a7d2
treee565c1d6f1b3809849329b6abeb8df9ea944c67b
parent7fe35f0e6b660f5667ff653f3b753bc3e5d07901
Store the operator table more compactly.

The four cases for each operator:

    none-are-opaque, src-is-opaque, dest-is-opaque, both-are-opaque

are packed into one uint32_t per operator. The relevant strength
reduced operator can then be found by packing the source-is-opaque and
dest-is-opaque into two bits and shifting that number of bytes.

Chris Wilson pointed out a bug in the original version of this commit:
dest_is_opaque and source_is_opaque were used as booleans, but their
actual values were the results of a logical AND with the
FAST_PATH_OPAQUE flag, so the shift value was wildly wrong.

The only reason it actually passed the test suite (on x86) was that
the compiler computed the shift amount in the cl register, and the low
byte of FAST_PATH_OPAQUE happens to be 0, so no shifting actually took
place, and the original operator was returned.
pixman/pixman.c