[PATCH 4/8] splash command: simplify offscreen rendering

Sascha Hauer s.hauer at pengutronix.de
Fri Aug 7 06:45:37 PDT 2015


Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 commands/splash.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/commands/splash.c b/commands/splash.c
index 90f0a0c..29e30ae 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)
-- 
2.4.6




More information about the barebox mailing list