summaryrefslogtreecommitdiff
path: root/test/thread-test.c
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-01-18 22:25:36 -0500
committerSøren Sandmann <ssp@redhat.com>2014-01-04 16:13:27 -0500
commite7a99b3b0f605d3f9937bc79e4385c6b71df7845 (patch)
tree8851094dfde73aaf7bc46771223efaf41cb182db /test/thread-test.c
parentfe3504d03fafbd8462a34fbe6150254eeb1d0bcd (diff)
downloadpixman-e7a99b3b0f605d3f9937bc79e4385c6b71df7845.tar.gz
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/thread-test.c')
-rw-r--r--test/thread-test.c2
1 files changed, 1 insertions, 1 deletions
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)
{