aboutsummaryrefslogtreecommitdiffstats
path: root/fbi.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-02-01 23:01:03 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-02-01 23:01:03 +0100
commitb8e5897b4edb640012f43dc87b7c84194163a153 (patch)
tree0ad9b3858b615ed53f9598481249e5c28e07d189 /fbi.c
parent83a73a82f5c91c0ab223649a0e9af5430cfa3b9a (diff)
downloadfbida-b8e5897b4edb640012f43dc87b7c84194163a153.tar.gz
use pixman for image blit+blend
Diffstat (limited to 'fbi.c')
-rw-r--r--fbi.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/fbi.c b/fbi.c
index b40010c..6111641 100644
--- a/fbi.c
+++ b/fbi.c
@@ -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)