aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/scaling-test.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-09-24 08:28:39 +0200
committermarha <marha@users.sourceforge.net>2012-09-24 08:28:39 +0200
commit0ebcd32e91486caccc041c8ca23e39e160b24702 (patch)
tree50cd0bc17e8a587fdbecdf52be48fe8c59e222b9 /pixman/test/scaling-test.c
parent06d4ea68085558b94d8e9c937091e7b7fcc5d95a (diff)
downloadvcxsrv-0ebcd32e91486caccc041c8ca23e39e160b24702.tar.gz
vcxsrv-0ebcd32e91486caccc041c8ca23e39e160b24702.tar.bz2
vcxsrv-0ebcd32e91486caccc041c8ca23e39e160b24702.zip
mesa pixman xserver git update 24 sep 2012
xserver: 7722bcbab2507d263c7685b15cccbfdd52fc3a24 pixman: c4b69e706e63e01fbc70e0026c2079007c89de14 mesa: c432c86e6aeebeb46c028af940224c59faa16e88
Diffstat (limited to 'pixman/test/scaling-test.c')
-rw-r--r--pixman/test/scaling-test.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/pixman/test/scaling-test.c b/pixman/test/scaling-test.c
index 44c4f3de4..273612395 100644
--- a/pixman/test/scaling-test.c
+++ b/pixman/test/scaling-test.c
@@ -20,6 +20,31 @@
/*
* Composite operation with pseudorandom images
*/
+
+static pixman_format_code_t
+get_format (int bpp)
+{
+ if (bpp == 4)
+ {
+ switch (lcg_rand_n (4))
+ {
+ default:
+ case 0:
+ return PIXMAN_a8r8g8b8;
+ case 1:
+ return PIXMAN_x8r8g8b8;
+ case 2:
+ return PIXMAN_a8b8g8r8;
+ case 3:
+ return PIXMAN_x8b8g8r8;
+ }
+ }
+ else
+ {
+ return PIXMAN_r5g6b5;
+ }
+}
+
uint32_t
test_composite (int testnum,
int verbose)
@@ -124,11 +149,8 @@ test_composite (int testnum,
for (i = 0; i < dst_stride * dst_height; i++)
*((uint8_t *)dstbuf + i) = lcg_rand_n (256);
- src_fmt = src_bpp == 4 ? (lcg_rand_n (2) == 0 ?
- PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
-
- dst_fmt = dst_bpp == 4 ? (lcg_rand_n (2) == 0 ?
- PIXMAN_a8r8g8b8 : PIXMAN_x8r8g8b8) : PIXMAN_r5g6b5;
+ src_fmt = get_format (src_bpp);
+ dst_fmt = get_format (dst_bpp);
src_img = pixman_image_create_bits (
src_fmt, src_width, src_height, srcbuf, src_stride);
@@ -322,7 +344,7 @@ 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)
+ if (dst_fmt == PIXMAN_x8r8g8b8 || dst_fmt == PIXMAN_x8b8g8r8)
{
/* ignore unused part */
for (i = 0; i < dst_stride * dst_height / 4; i++)
@@ -358,11 +380,11 @@ test_composite (int testnum,
}
#if BILINEAR_INTERPOLATION_BITS == 8
-#define CHECKSUM 0x80DF1CB2
+#define CHECKSUM 0x8D3A7539
#elif BILINEAR_INTERPOLATION_BITS == 7
-#define CHECKSUM 0x2818D5FB
+#define CHECKSUM 0x03A23E0C
#elif BILINEAR_INTERPOLATION_BITS == 4
-#define CHECKSUM 0x387540A5
+#define CHECKSUM 0xE96D1A5E
#else
#define CHECKSUM 0x00000000
#endif