summaryrefslogtreecommitdiff
path: root/draw/blendmodes.c
diff options
context:
space:
mode:
Diffstat (limited to 'draw/blendmodes.c')
-rw-r--r--draw/blendmodes.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/draw/blendmodes.c b/draw/blendmodes.c
index 0c8c7eec..184e1a28 100644
--- a/draw/blendmodes.c
+++ b/draw/blendmodes.c
@@ -326,12 +326,24 @@ fz_blendnonseparable(byte * restrict bp, byte * restrict sp, int w, fz_blendmode
}
void
-fz_blendpixmapswithmode(fz_pixmap *dst, fz_pixmap *src, fz_blendmode blendmode)
+fz_blendpixmap(fz_pixmap *dst, fz_pixmap *src, int alpha, fz_blendmode blendmode)
{
unsigned char *sp, *dp;
fz_bbox bbox;
int x, y, w, h, n;
+ /* TODO: fix this hack! */
+ if (alpha < 255)
+ {
+ sp = src->samples;
+ n = src->w * src->h * src->n;
+ while (n--)
+ {
+ *sp = fz_mul255(*sp, alpha);
+ sp++;
+ }
+ }
+
bbox = fz_boundpixmap(dst);
bbox = fz_intersectbbox(bbox, fz_boundpixmap(src));