+ unsigned int need0 = 0;
+ unsigned short r = *rnd;
+ for (i = 0; i != npoints; i++)
+ {
+ points[i].x = r % size + x;
+ points[i].y = (r >> 8) % size + y;
+
+ /* Xorshift. This has a period of 2^16, which exactly matches
+ the number of pixels in each 256x256 chunk.
+
+ Other shift constants are possible, but it's hard to say
+ which constants are best: a 2^16 period PRNG will never score
+ well on BigCrush.
+ */
+ r = (r ^ (r << 3)) & 0xffff;
+ r = r ^ (r >> 5);
+ r = (r ^ (r << 11)) & 0xffff;
+ need0 |= (r == 0x8080); /* Can be anything, really. */
+ }
+
+ if (need0)
+ {
+ points[npoints].x = x;
+ points[npoints].y = y;
+ }
+
+ XDrawPoints (st->dpy, st->window, st->bg_gc,
+ points, npoints + need0, CoordModeOrigin);
+ *rnd = r;
+ rnd++;