summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-08-07 14:42:58 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-08-20 12:57:08 +0200
commitcabfe34ca70acbb009ad94b2578fde99957472a7 (patch)
treeca91a5c341803034131cbe07d2f869528697724a /lib
parent7c5937d245b4ecf3c1c33eecfda0851aa277dbc6 (diff)
downloadbarebox-cabfe34ca70acbb009ad94b2578fde99957472a7.tar.gz
barebox-cabfe34ca70acbb009ad94b2578fde99957472a7.tar.xz
gui: implement blitting screen areas
So far we only supported blitting the whole screen from the shadow fb to the framebuffer. Add a function to blit areas. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/gui/graphic_utils.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index b57b4a1f9a..4c1885d55b 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -306,6 +306,25 @@ void fb_close(struct screen *sc)
free(sc);
}
+void gu_screen_blit_area(struct screen *sc, int startx, int starty, int width,
+ int height)
+{
+ struct fb_info *info = sc->info;
+ int bpp = info->bits_per_pixel >> 3;
+
+ if (info->screen_base_shadow) {
+ int y;
+ void *fb = info->screen_base + starty * sc->info->line_length + startx * bpp;
+ void *fboff = info->screen_base_shadow + starty * sc->info->line_length + startx * bpp;
+
+ for (y = starty; y < starty + height; y++) {
+ memcpy(fb, fboff, width * bpp);
+ fb += sc->info->line_length;
+ fboff += sc->info->line_length;
+ }
+ }
+}
+
void gu_screen_blit(struct screen *sc)
{
struct fb_info *info = sc->info;