diff options
author | Søren Sandmann Pedersen <ssp@redhat.com> | 2013-01-18 22:25:36 -0500 |
---|---|---|
committer | Søren Sandmann <ssp@redhat.com> | 2014-01-04 16:13:27 -0500 |
commit | e7a99b3b0f605d3f9937bc79e4385c6b71df7845 (patch) | |
tree | 8851094dfde73aaf7bc46771223efaf41cb182db /test | |
parent | fe3504d03fafbd8462a34fbe6150254eeb1d0bcd (diff) |
pixman/pixman-combine32.c: Bug fixes for separable blend modes
This commit fixes four separate bugs:
1. In the computation
(1 - sa) * d + (1 - da) * s + sa * da * B(s, d)
we were using regular addition for all four channels, but for
superluminescent pixels, the addition could overflow causing
nonsensical results.
2. The variables and return types used for the results of the blend
mode calculations were unsigned, but for various blend modes (and
especially with superluminescent pixels), the blend mode
calculations could be negative, resulting in underflows.
3. The blend mode computations were returned as 8-bit values, which is
not sufficient precision (especially considering that we need
signed results).
4. The value before the final division by 255 was not properly clamped
to [0, 255].
This patch fixes all those bugs. The blend mode computations are now
returned as signed 16 bit values with 1 represented as 255 * 255.
With these fixes, the number of failing pixels in pixel-test goes down
from 431 to 384.
Diffstat (limited to 'test')
-rw-r--r-- | test/blitters-test.c | 2 | ||||
-rw-r--r-- | test/thread-test.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/test/blitters-test.c b/test/blitters-test.c index df82358..ac8901f 100644 --- a/test/blitters-test.c +++ b/test/blitters-test.c @@ -394,6 +394,6 @@ main (int argc, const char *argv[]) } return fuzzer_test_main("blitters", 2000000, - 0x63B4E3F3, + 0x613BBD64, test_composite, argc, argv); } diff --git a/test/thread-test.c b/test/thread-test.c index 0b07b26..8fa2098 100644 --- a/test/thread-test.c +++ b/test/thread-test.c @@ -183,7 +183,7 @@ main (void) crc32 = compute_crc32 (0, crc32s, sizeof crc32s); -#define EXPECTED 0xE299B18E +#define EXPECTED 0xE8D161DF if (crc32 != EXPECTED) { |