[librsvg] tests: Mark pixels in diff where only the alpha channel differs
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] tests: Mark pixels in diff where only the alpha channel differs
- Date: Thu, 22 Oct 2015 11:14:35 +0000 (UTC)
commit 79c93aa2006f6491059f66b9ba0eeba05531eeee
Author: Benjamin Otte <otte redhat com>
Date: Sun Oct 18 23:59:27 2015 +0200
tests: Mark pixels in diff where only the alpha channel differs
tests/rsvg-test.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tests/rsvg-test.c b/tests/rsvg-test.c
index d6f73de..29dae79 100644
--- a/tests/rsvg-test.c
+++ b/tests/rsvg-test.c
@@ -99,6 +99,11 @@ buffer_diff_core (unsigned char *_buf_a,
}
result.pixels_changed++;
+ if ((diff_pixel & 0x00ffffff) == 0) {
+ /* alpha only difference, convert to luminance */
+ guint8 alpha = diff_pixel >> 24;
+ diff_pixel = alpha * 0x010101;
+ }
row[x] = diff_pixel;
} else {
row[x] = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]