diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-09-26 11:59:04 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-10-04 17:22:09 +0200 |
commit | 5eb89cea2a4e00288323e3c3daf3c47d4c80d652 (patch) | |
tree | c39955a04f8254c0bb49629cdea8648b5a3c798d /lib/gui | |
parent | 9a048064e4803340cfe997dada9f09b00077a1f5 (diff) | |
download | barebox-5eb89cea2a4e00288323e3c3daf3c47d4c80d652.tar.gz barebox-5eb89cea2a4e00288323e3c3daf3c47d4c80d652.tar.xz |
gui: blit the surface on demand
Do not blit the surface everytime we write an image
As we want to able to render multiple image this will cause 1 blit per image;
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/gui')
-rw-r--r-- | lib/gui/bmp.c | 3 | ||||
-rw-r--r-- | lib/gui/graphic_utils.c | 8 | ||||
-rw-r--r-- | lib/gui/png.c | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/lib/gui/bmp.c b/lib/gui/bmp.c index c88037568b..d5761215d1 100644 --- a/lib/gui/bmp.c +++ b/lib/gui/bmp.c @@ -117,9 +117,6 @@ static int bmp_renderer(struct screen *sc, struct surface *s, struct image *img) } else printf("bmp: illegal bits per pixel value: %d\n", bits_per_pixel); - if (sc->offscreenbuf) - memcpy(sc->fb, sc->offscreenbuf, sc->fbsize); - return img->height; } diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c index 15a41094a9..3800ee2832 100644 --- a/lib/gui/graphic_utils.c +++ b/lib/gui/graphic_utils.c @@ -242,3 +242,11 @@ void fb_close(struct screen *sc) free(sc->offscreenbuf); close(sc->fd); } + +void screen_blit(struct screen *sc) +{ + if (!sc->offscreenbuf) + return; + + memcpy(sc->fb, sc->offscreenbuf, sc->fbsize); +} diff --git a/lib/gui/png.c b/lib/gui/png.c index 36b95f6afc..2921ab3057 100644 --- a/lib/gui/png.c +++ b/lib/gui/png.c @@ -69,9 +69,6 @@ static int png_renderer(struct screen *sc, struct surface *s, struct image *img) rgba_blend(&sc->info, img, buf, height, width, startx, starty, true); - if (sc->offscreenbuf) - memcpy(sc->fb, sc->offscreenbuf, sc->fbsize); - return img->height; } |