tests: implement visualize_image_difference()
Useful for pointing out where the image comparisons fail.
Internal-screenshot-test is modified to save the visualization if the
test fails.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
diff --git a/tests/weston-test-client-helper.h b/tests/weston-test-client-helper.h
index 794abb3..d6ecb5f 100644
--- a/tests/weston-test-client-helper.h
+++ b/tests/weston-test-client-helper.h
@@ -201,6 +201,10 @@
check_images_match(pixman_image_t *img_a, pixman_image_t *img_b,
const struct rectangle *clip);
+pixman_image_t *
+visualize_image_difference(pixman_image_t *img_a, pixman_image_t *img_b,
+ const struct rectangle *clip_rect);
+
bool
write_image_as_png(pixman_image_t *image, const char *fname);