From: Ray Strode Date: Mon, 2 Jun 2008 20:06:51 +0000 (-0400) Subject: Add back a FIXME back to the gradient code X-Git-Tag: 0.2.0~47^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e03a9e52dbb9db5ccb5d64811939f23872a6487;p=thirdparty%2Fplymouth.git Add back a FIXME back to the gradient code I accidentally dropped the FIXME when I wrote my comments in the last commit. --- diff --git a/src/libply/ply-frame-buffer.c b/src/libply/ply-frame-buffer.c index b94f2874..31246f5c 100644 --- a/src/libply/ply-frame-buffer.c +++ b/src/libply/ply-frame-buffer.c @@ -714,6 +714,14 @@ ply_frame_buffer_fill_with_gradient (ply_frame_buffer_t *buffer, */ srand(100200); +/* FIXME: we assume RAND_MAX is at least 24 bits here, and it is on linux. + * On some platforms it's only 16its though. If that were true on linux, + * then NOISE_BITS would get effectively ignored, since those bits would + * always overlap with zeros. We could fix it by running rand() twice + * per channel generating 32-bits of noise, or by shifting the result of + * rand() over 8 bits, such that the zeros would be overlapping with the + * least significant fractional bits of the color channel instead. + */ #define NOISE() (rand () & NOISE_MASK) for (y = buffer->area.y; y < buffer->area.y + buffer->area.height; y++)