diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-08-07 14:41:17 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-08-20 12:57:08 +0200 |
commit | 7c5937d245b4ecf3c1c33eecfda0851aa277dbc6 (patch) | |
tree | 158710e0e3a13fe41311deddadf22fd663aadcfb /lib | |
parent | 38a71cde8f6e8ce175428dff16b1a89b4b7a7843 (diff) | |
download | barebox-7c5937d245b4ecf3c1c33eecfda0851aa277dbc6.tar.gz barebox-7c5937d245b4ecf3c1c33eecfda0851aa277dbc6.tar.xz |
gui: Use fb provided shadowfb for offscreen rendering
The fb core now has builtin support for offscreen rendering, use
this and drop offscreen handling in the gui code.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gui/graphic_utils.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index f928ee16f4..b57b4a1f9a 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -245,7 +245,7 @@ void gu_rgba_blend(struct fb_info *info, struct image *img, void* buf, int heigh } } -struct screen *fb_create_screen(struct fb_info *info, bool offscreen) +struct screen *fb_create_screen(struct fb_info *info) { struct screen *sc; @@ -257,19 +257,12 @@ struct screen *fb_create_screen(struct fb_info *info, bool offscreen) sc->s.height = info->yres; sc->fbsize = info->line_length * sc->s.height; sc->fb = info->screen_base; - - if (offscreen) { - /* - * Don't fail if malloc fails, just continue rendering directly - * on the framebuffer - */ - sc->offscreenbuf = malloc(sc->fbsize); - } + sc->info = info; return sc; } -struct screen *fb_open(const char * fbdev, bool offscreen) +struct screen *fb_open(const char * fbdev) { int fd, ret; struct fb_info *info; @@ -286,7 +279,7 @@ struct screen *fb_open(const char * fbdev, bool offscreen) goto failed_screeninfo; } - sc = fb_create_screen(info, offscreen); + sc = fb_create_screen(info); if (IS_ERR(sc)) { ret = PTR_ERR(sc); goto failed_create; @@ -298,7 +291,6 @@ struct screen *fb_open(const char * fbdev, bool offscreen) return sc; failed_create: - free(sc->offscreenbuf); free(sc); failed_screeninfo: close(fd); @@ -308,8 +300,6 @@ failed_screeninfo: void fb_close(struct screen *sc) { - free(sc->offscreenbuf); - if (sc->fd > 0) close(sc->fd); @@ -318,8 +308,8 @@ void fb_close(struct screen *sc) void gu_screen_blit(struct screen *sc) { - if (!sc->offscreenbuf) - return; + struct fb_info *info = sc->info; - memcpy(sc->fb, sc->offscreenbuf, sc->fbsize); + if (info->screen_base_shadow) + memcpy(info->screen_base, info->screen_base_shadow, sc->fbsize); } |