aboutsummaryrefslogtreecommitdiff
path: root/pixman/test/utils.h
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-20 14:53:20 +0000
committermarha <marha@users.sourceforge.net>2009-11-20 14:53:20 +0000
commit9e11b82359e90c0963f56c4695a4dcc8731e45c3 (patch)
treeffa3a53246352ca44ccfc4d90e7cca993ad0b02e /pixman/test/utils.h
parent607c11e20aca5c9f13d5e6ab80153b10c249162b (diff)
parent4ac4a5b7ce8cc8f195d69a42da10d386eaa5c056 (diff)
downloadvcxsrv-9e11b82359e90c0963f56c4695a4dcc8731e45c3.tar.gz
vcxsrv-9e11b82359e90c0963f56c4695a4dcc8731e45c3.tar.bz2
vcxsrv-9e11b82359e90c0963f56c4695a4dcc8731e45c3.zip
svn merge ^/branches/released
Diffstat (limited to 'pixman/test/utils.h')
-rw-r--r--pixman/test/utils.h43
1 files changed, 39 insertions, 4 deletions
diff --git a/pixman/test/utils.h b/pixman/test/utils.h
index bc110d847..8fdb2ce4f 100644
--- a/pixman/test/utils.h
+++ b/pixman/test/utils.h
@@ -1,6 +1,41 @@
-#include <stdio.h>
#include <stdlib.h>
-#include <glib.h>
-#include "pixman.h"
+#include <config.h>
+#include "pixman-private.h" /* For 'inline' definition */
-void show_image (pixman_image_t *image);
+/* A primitive pseudorandom number generator,
+ * taken from POSIX.1-2001 example
+ */
+
+extern uint32_t lcg_seed;
+
+static inline uint32_t
+lcg_rand (void)
+{
+ lcg_seed = lcg_seed * 1103515245 + 12345;
+ return ((uint32_t)(lcg_seed / 65536) % 32768);
+}
+
+static inline void
+lcg_srand (uint32_t seed)
+{
+ lcg_seed = seed;
+}
+
+static inline uint32_t
+lcg_rand_n (int max)
+{
+ return lcg_rand () % max;
+}
+
+
+/* CRC 32 computation
+ */
+uint32_t
+compute_crc32 (uint32_t in_crc32,
+ const void *buf,
+ size_t buf_len);
+
+/* perform endian conversion of pixel data
+ */
+void
+image_endian_swap (pixman_image_t *img, int bpp);