summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <ssp@redhat.com>2013-09-12 12:24:52 -0400
committerSøren Sandmann Pedersen <ssp@redhat.com>2013-09-19 21:37:56 -0400
commit51d71354568a54114ced87d8ae1529c88a53f635 (patch)
treebd9dd1759ed5108eca835ca564cc7f37874642d7
parent75506e63677208c1ec4364ab1a4b4fb73a0ca6c8 (diff)
{scaling,affine,composite-traps}-test: Use compute_crc32_for_image()
By using this function instead of compute_crc32() the alpha masking code and the call to image_endian_swap() are not duplicated.
-rw-r--r--test/affine-test.c12
-rw-r--r--test/composite-traps-test.c11
-rw-r--r--test/scaling-test.c12
3 files changed, 5 insertions, 30 deletions
diff --git a/test/affine-test.c b/test/affine-test.c
index c1649ed..3a37d7f 100644
--- a/test/affine-test.c
+++ b/test/affine-test.c
@@ -273,15 +273,8 @@ test_composite (int testnum,
pixman_image_composite (op, src_img, NULL, dst_img,
src_x, src_y, 0, 0, dst_x, dst_y, w, h);
- if (dst_fmt == PIXMAN_x8r8g8b8)
- {
- /* ignore unused part */
- for (i = 0; i < dst_stride * dst_height / 4; i++)
- dstbuf[i] &= 0xFFFFFF;
- }
-
- image_endian_swap (dst_img);
-
+ crc32 = compute_crc32_for_image (0, dst_img);
+
if (verbose)
{
int j;
@@ -298,7 +291,6 @@ test_composite (int testnum,
pixman_image_unref (src_img);
pixman_image_unref (dst_img);
- crc32 = compute_crc32 (0, dstbuf, dst_stride * dst_height);
free (srcbuf);
free (dstbuf);
diff --git a/test/composite-traps-test.c b/test/composite-traps-test.c
index 2983eae..34ae340 100644
--- a/test/composite-traps-test.c
+++ b/test/composite-traps-test.c
@@ -214,14 +214,7 @@ test_composite (int testnum,
pixman_composite_trapezoids (op, src_img, dst_img, mask_format,
src_x, src_y, dst_x, dst_y, n_traps, traps);
- if (dst_format == PIXMAN_x8r8g8b8)
- {
- /* ignore unused part */
- for (i = 0; i < dst_stride * dst_height / 4; i++)
- dst_bits[i] &= 0xFFFFFF;
- }
-
- image_endian_swap (dst_img);
+ crc32 = compute_crc32_for_image (0, dst_img);
if (verbose)
{
@@ -236,8 +229,6 @@ test_composite (int testnum,
}
}
- crc32 = compute_crc32 (0, dst_bits, dst_stride * dst_height);
-
fence_free (dst_bits);
pixman_image_unref (src_img);
diff --git a/test/scaling-test.c b/test/scaling-test.c
index b4142a7..04ecb63 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -340,15 +340,8 @@ test_composite (int testnum,
pixman_image_composite (op, src_img, mask_img, dst_img,
src_x, src_y, mask_x, mask_y, dst_x, dst_y, w, h);
- if (dst_fmt == PIXMAN_x8r8g8b8 || dst_fmt == PIXMAN_x8b8g8r8)
- {
- /* ignore unused part */
- for (i = 0; i < dst_stride * dst_height / 4; i++)
- dstbuf[i] &= 0xFFFFFF;
- }
-
- image_endian_swap (dst_img);
-
+ crc32 = compute_crc32_for_image (0, dst_img);
+
if (verbose)
{
int j;
@@ -366,7 +359,6 @@ test_composite (int testnum,
pixman_image_unref (mask_img);
pixman_image_unref (dst_img);
- crc32 = compute_crc32 (0, dstbuf, dst_stride * dst_height);
free (srcbuf);
free (maskbuf);
free (dstbuf);