diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-09-02 22:19:27 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-09-02 22:19:27 +0000 |
commit | a45cbad55322ac7fbad1e49d416d2eda62f1940e (patch) | |
tree | 3f3a07304cd458dc6dc38a6052b2e32e66ef791d | |
parent | 82a184a7b774ca647b06314fbd3702bd7905ff8d (diff) | |
parent | 16b9a30655d658a44bf7de316e76481303a408e8 (diff) | |
download | gtk+-a45cbad55322ac7fbad1e49d416d2eda62f1940e.tar.gz |
Merge branch 'wip/smcv/transparent-is-transparent' into 'master'
reftest-compare: Treat colour channels as undefined if alpha is zero
Closes #4227
See merge request GNOME/gtk!3914
-rw-r--r-- | testsuite/reftests/reftest-compare.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/testsuite/reftests/reftest-compare.c b/testsuite/reftests/reftest-compare.c index 5c682e1591..5bccb697b8 100644 --- a/testsuite/reftests/reftest-compare.c +++ b/testsuite/reftests/reftest-compare.c @@ -104,7 +104,12 @@ buffer_diff_core (const guchar *buf_a, /* check if the pixels are the same */ if (row_a[x] == row_b[x]) continue; - + + /* even if they're not literally the same, fully-transparent + * pixels are effectively the same regardless of colour */ + if ((row_a[x] & 0xff000000) == 0 && (row_b[x] & 0xff000000) == 0) + continue; + if (diff == NULL) { diff = cairo_image_surface_create (CAIRO_FORMAT_RGB24, |