summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pixman/pixman-combine32.c15
-rw-r--r--test/blitters-test.c2
-rw-r--r--test/thread-test.c2
3 files changed, 9 insertions, 10 deletions
diff --git a/pixman/pixman-combine32.c b/pixman/pixman-combine32.c
index 25c0053..450114a 100644
--- a/pixman/pixman-combine32.c
+++ b/pixman/pixman-combine32.c
@@ -779,15 +779,14 @@ PDF_SEPARABLE_BLEND_MODE (color_dodge)
static inline uint32_t
blend_color_burn (uint32_t d, uint32_t ad, uint32_t s, uint32_t as)
{
- if (s == 0)
- {
- return d < ad ? 0 : DIV_ONE_UN8 (as * ad);
- }
+ if (d >= ad)
+ return DIV_ONE_UN8 (ad * as);
+ else if (as * ad - as * d >= ad * s)
+ return 0;
+ else if (s == 0)
+ return 0;
else
- {
- uint32_t r = (ad - d) * as / s;
- return DIV_ONE_UN8 (as * (MAX (r, ad) - r));
- }
+ return DIV_ONE_UN8 (ad * as - (as * as * (ad - d)) / s);
}
PDF_SEPARABLE_BLEND_MODE (color_burn)
diff --git a/test/blitters-test.c b/test/blitters-test.c
index 396b5b5..ea03f47 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,
- 0x6A783AD5,
+ 0xE0A07495,
test_composite, argc, argv);
}
diff --git a/test/thread-test.c b/test/thread-test.c
index bf49f6b..fa21933 100644
--- a/test/thread-test.c
+++ b/test/thread-test.c
@@ -184,7 +184,7 @@ main (void)
crc32 = compute_crc32 (0, crc32s, sizeof crc32s);
-#define EXPECTED 0x12F4B484
+#define EXPECTED 0xE299B18E
if (crc32 != EXPECTED)
{