Fix xrender APPLY_ALPHA

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-05-21 20:22:20 +01:00
parent 488db11f14
commit 294aae11ff
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 3 additions and 3 deletions

View File

@ -422,10 +422,10 @@ static bool image_op(backend_t *base, enum image_operations op, void *image,
break;
}
auto alpha_pict = xd->alpha_pict[(int)(dargs[0] * 255)];
auto alpha_pict = xd->alpha_pict[(int)((1-dargs[0]) * 255)];
x_set_picture_clip_region(base->c, img->pict, 0, 0, &reg);
xcb_render_composite(base->c, XCB_RENDER_PICT_OP_IN, img->pict, XCB_NONE,
alpha_pict, 0, 0, 0, 0, 0, 0, tmpw, tmph);
xcb_render_composite(base->c, XCB_RENDER_PICT_OP_OUT_REVERSE, alpha_pict, XCB_NONE,
img->pict, 0, 0, 0, 0, 0, 0, tmpw, tmph);
img->has_alpha = true;
break;
case IMAGE_OP_RESIZE_TILE: