summaryrefslogtreecommitdiffstats
path: root/commands/splash.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-07 14:38:58 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-20 12:57:08 +0200
commit38a71cde8f6e8ce175428dff16b1a89b4b7a7843 (patch)
tree815bac7e1baa01a76681f3dbe88bde77acf8db53 /commands/splash.c
parent6f964990646cd728827e1d8689404878fae0a1fd (diff)
downloadbarebox-38a71cde8f6e8ce175428dff16b1a89b4b7a7843.tar.gz
barebox-38a71cde8f6e8ce175428dff16b1a89b4b7a7843.tar.xz
splash command: simplify offscreen rendering
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/splash.c')
-rw-r--r--commands/splash.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/commands/splash.c b/commands/splash.c
index 90f0a0cdf2..29e30ae3b0 100644
--- a/commands/splash.c
+++ b/commands/splash.c
@@ -18,6 +18,7 @@ static int do_splash(int argc, char *argv[])
int offscreen = 0;
u32 bg_color = 0x00000000;
bool do_bg = false;
+ void *buf;
memset(&s, 0, sizeof(s));
@@ -58,15 +59,11 @@ static int do_splash(int argc, char *argv[])
return PTR_ERR(sc);
}
- if (sc->offscreenbuf) {
- if (do_bg)
- gu_memset_pixel(sc->info, sc->offscreenbuf, bg_color,
- sc->s.width * sc->s.height);
- else
- memcpy(sc->offscreenbuf, sc->fb, sc->fbsize);
- } else if (do_bg) {
- gu_memset_pixel(sc->info, sc->fb, bg_color, sc->s.width * sc->s.height);
- }
+ buf = gui_screen_render_buffer(sc);
+
+ if (do_bg)
+ gu_memset_pixel(sc->info, buf, bg_color,
+ sc->s.width * sc->s.height);
ret = image_renderer_file(sc, &s, image_file);
if (ret > 0)