[Pixman] [PATCH 01/19] test: Add affine-test
Siarhei Siamashka
siarhei.siamashka at gmail.com
Fri Sep 17 13:37:53 PDT 2010
On Thursday 16 September 2010 17:53:41 Søren Sandmann wrote:
> From: Søren Sandmann Pedersen <ssp at redhat.com>
>
> This test tests compositing with various affine transformations. It is
> almost identical to scaling-test, except that it also applies a random
> rotation in addition to the random scaling and translation.
[...]
> + if (lcg_rand_n (2) > 0)
> + {
> + int c = lcg_rand_n (2 * 65536) - 65536;
> + int s = lcg_rand_n (2 * 65536) - 65536;
This looks like my old bug from the 'scaling-test', and now it got replicated
in 'affine-test'. The problems is that the pseudo-random number generator
itself has a very limited range and can only provide the numbers up to 32K. I
added another function lcg_rand_N() to address this problem:
http://cgit.freedesktop.org/pixman/commit/?id=226a6df4f947f718d82e85ca53561a968ec0c0a1
The older function was still kept because it is faster and works fine for
generating random bytes or other small numbers.
--
Best regards,
Siarhei Siamashka
More information about the Pixman
mailing list