diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-01 23:01:03 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2019-02-01 23:01:03 +0100 |
commit | b8e5897b4edb640012f43dc87b7c84194163a153 (patch) | |
tree | 0ad9b3858b615ed53f9598481249e5c28e07d189 /fbi.c | |
parent | 83a73a82f5c91c0ab223649a0e9af5430cfa3b9a (diff) | |
download | fbida-b8e5897b4edb640012f43dc87b7c84194163a153.tar.gz |
use pixman for image blit+blend
Diffstat (limited to 'fbi.c')
-rw-r--r-- | fbi.c | 26 |
1 files changed, 3 insertions, 23 deletions
@@ -365,41 +365,21 @@ static void shadow_draw_image(struct ida_image *img, int xoff, int yoff, unsigned int first, unsigned int last, int weight) { - unsigned int dwidth = MIN(img->i.width, gfx->hdisplay); - unsigned int dheight = MIN(img->i.height, gfx->vdisplay); - unsigned int data, offset, y, xs, ys; + unsigned int xs, ys; if (100 == weight) shadow_clear_lines(first, last); else shadow_darkify(0, gfx->hdisplay-1, first, last, 100 - weight); - /* offset for image data (image > screen, select visible area) */ - offset = (yoff * img->i.width + xoff) * 3; - - /* offset for video memory (image < screen, center image) */ + /* image < screen: center image */ xs = 0, ys = 0; if (img->i.width < gfx->hdisplay) xs += (gfx->hdisplay - img->i.width) / 2; if (img->i.height < gfx->vdisplay) ys += (gfx->vdisplay - img->i.height) / 2; - /* go ! */ - for (data = 0, y = 0; - data < img->i.width * img->i.height * 3 - && data / img->i.width / 3 < dheight; - data += img->i.width * 3, y++) { - if (ys+y < first) - continue; - if (ys+y > last) - continue; - if (100 == weight) - shadow_draw_rgbdata(xs, ys+y, dwidth, - ida_image_scanline(img, y) + offset); - else - shadow_merge_rgbdata(xs, ys+y, dwidth, weight, - ida_image_scanline(img, y) + offset); - } + shadow_composite_image(img, xs - xoff, ys - yoff, weight); } static void status_prepare(void) |