summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2009-09-27 09:41:25 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2009-10-26 13:04:21 -0400
commitf0c157f888185279681bad305973f246dca2e535 (patch)
tree14618b25a21f8e2b36107513469311a16061a1a5
parenteab882ef38509bfc9719fcee6020d882ee030694 (diff)
Extend scaling-test to also test bilinear filtering.
-rw-r--r--test/scaling-test.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/test/scaling-test.c b/test/scaling-test.c
index c158c23c..e7686cdb 100644
--- a/test/scaling-test.c
+++ b/test/scaling-test.c
@@ -137,7 +137,7 @@ compute_crc32 (uint32_t in_crc32,
0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
};
-
+
uint32_t crc32;
unsigned char * byte_buf;
size_t i;
@@ -148,7 +148,7 @@ compute_crc32 (uint32_t in_crc32,
for (i = 0; i < buf_len; i++)
crc32 = (crc32 >> 8) ^ crc_table[(crc32 ^ byte_buf[i]) & 0xFF];
-
+
return (crc32 ^ 0xFFFFFFFF);
}
@@ -170,7 +170,7 @@ image_endian_swap (pixman_image_t *img,
for (i = 0; i < height; i++)
{
char *line_data = (char *)data + stride * i;
-
+
/* swap bytes only for 16, 24 and 32 bpp for now */
switch (bpp)
{
@@ -266,7 +266,7 @@ test_composite (uint32_t initcrc,
if (src_stride & 3)
src_stride += 2;
-
+
if (dst_stride & 3)
dst_stride += 2;
@@ -332,6 +332,11 @@ test_composite (uint32_t initcrc,
}
pixman_image_set_repeat (src_img, repeat);
+ if (lcg_rand_n (2))
+ pixman_image_set_filter (src_img, PIXMAN_FILTER_NEAREST, NULL, 0);
+ else
+ pixman_image_set_filter (src_img, PIXMAN_FILTER_BILINEAR, NULL, 0);
+
if (verbose)
{
printf ("src_fmt=%08X, dst_fmt=%08X\n", src_fmt, dst_fmt);
@@ -365,7 +370,7 @@ test_composite (uint32_t initcrc,
clip_boxes[i].x2, clip_boxes[i].y2);
}
}
-
+
pixman_region_init_rects (&clip, clip_boxes, n);
pixman_image_set_clip_region (src_img, &clip);
pixman_image_set_source_clipping (src_img, 1);
@@ -461,7 +466,7 @@ main (int argc, char *argv[])
/* predefined value for running with all the fastpath functions disabled */
/* it needs to be updated every time changes are introduced to this program! */
- if (crc == 0x0B633CF4)
+ if (crc == 0x2168ACD1)
{
printf ("scaling test passed\n");
}