]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Add back a FIXME back to the gradient code
authorRay Strode <rstrode@redhat.com>
Mon, 2 Jun 2008 20:06:51 +0000 (16:06 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 2 Jun 2008 20:06:51 +0000 (16:06 -0400)
I accidentally dropped the FIXME when I wrote my comments
in the last commit.

src/libply/ply-frame-buffer.c

index b94f287435eee5e72e0563b4629fac407faffb9b..31246f5ca57d98b9571298efd9cc7265d0e2478d 100644 (file)
@@ -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++)