remove used fill_screen function

This commit is contained in:
David Anders
2014-09-23 13:37:50 -05:00
parent 77bdfc6ccb
commit a6da7bc189

View File

@@ -97,64 +97,6 @@ static void draw_pixel(struct fb_info *fb_info, int x, int y, unsigned color)
}
}
static void fill_screen(struct fb_info *fb_info)
{
unsigned x, y;
unsigned h = fb_info->var.yres_virtual;
unsigned w = fb_info->var.xres_virtual;
for (y = 0; y < h; y++) {
for (x = 0; x < w; x++) {
if (x < 20 && y < 20)
draw_pixel(fb_info, x, y, 0xffffff);
else if (x < 20 && (y > 20 && y < h - 20))
draw_pixel(fb_info, x, y, 0xff);
else if (y < 20 && (x > 20 && x < w - 20))
draw_pixel(fb_info, x, y, 0xff00);
else if (x > w - 20 && (y > 20 && y < h - 20))
draw_pixel(fb_info, x, y, 0xff0000);
else if (y > h - 20 && (x > 20 && x < w - 20))
draw_pixel(fb_info, x, y, 0xffff00);
else if (x == 20 || x == w - 20 ||
y == 20 || y == h - 20)
draw_pixel(fb_info, x, y, 0xffffff);
else if (x == y || w - x == h - y)
draw_pixel(fb_info, x, y, 0xff00ff);
else if (w - x == y || x == h - y)
draw_pixel(fb_info, x, y, 0x00ffff);
else if (x > 20 && y > 20 && x < w - 20 && y < h - 20) {
int t = x * 3 / w;
unsigned r = 0, g = 0, b = 0;
unsigned c;
if (fb_info->var.bits_per_pixel == 16) {
if (t == 0)
b = (y % 32) * 256 / 32;
else if (t == 1)
g = (y % 64) * 256 / 64;
else if (t == 2)
r = (y % 32) * 256 / 32;
} else {
if (t == 0)
b = (y % 256);
else if (t == 1)
g = (y % 256);
else if (t == 2)
r = (y % 256);
}
c = (r << 16) | (g << 8) | (b << 0);
draw_pixel(fb_info, x, y, c);
} else {
draw_pixel(fb_info, x, y, 0);
}
}
}
fb_put_string(fb_info, w / 3 * 2, 30, "RED", 3, 0xffffff, 1, 3);
fb_put_string(fb_info, w / 3, 30, "GREEN", 5, 0xffffff, 1, 5);
fb_put_string(fb_info, 20, 30, "BLUE", 4, 0xffffff, 1, 4);
}
void fill_screen_solid(struct fb_info *fb_info, unsigned int color)
{