summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-10-10 09:58:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-10-10 12:50:25 +0100
commit91b65e0a73b35a745921831b73f5f4589bb889b7 (patch)
tree667ca7a678543fcc8870920b79084bb3f95ace9e /desktop
parentcb02551714ca65145d4476f3525c0c7ad1d04f66 (diff)
coverity#1242395 Don't call random
Change-Id: Idd4adac71222e03d85446c86f1c086ce32528bd6 mmeeks: just chop that else {} block out in splashx and good riddance
Diffstat (limited to 'desktop')
-rw-r--r--desktop/unx/source/splashx.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c
index 71cde4213418..a300a0295227 100644
--- a/desktop/unx/source/splashx.c
+++ b/desktop/unx/source/splashx.c
@@ -354,36 +354,6 @@ static void create_pixmap(struct splash* splash)
XPutImage( splash->display, pixmap, pixmap_gc, image, 0, 0, 0, 0, splash->width, splash->height );
XDestroyImage( image );
}
- else //if ( depth == 1 || visual->class == DirectColor )
- {
- // FIXME Something like the following, but faster ;-) - XDrawPoint is not
- // a good idea...
- int x, y;
- for ( y = 0; y < splash->height; ++y )
- {
- color_t* color = (color_t *)&(splash->bitmap_rows[y]);
-
- int delta = 0;
- for ( x = 0; x < splash->width; ++x, ++color )
- {
- int rnd = (int)( ( (long)( random() - RAND_MAX/2 ) * 32000 )/RAND_MAX );
- int luminance = delta + rnd + 299 * (int)color->r + 587 * (int)color->g + 114 * (int)color->b;
-
- if ( luminance < 128000 )
- {
- XSetForeground( splash->display, pixmap_gc, BlackPixel( splash->display, splash->screen ) );
- delta = luminance;
- }
- else
- {
- XSetForeground( splash->display, pixmap_gc, WhitePixel( splash->display, splash->screen ) );
- delta = luminance - 255000;
- }
-
- XDrawPoint( splash->display, pixmap, pixmap_gc, x, y );
- }
- }
- }
XSetWindowBackgroundPixmap( splash->display, splash->win, pixmap );