--- rxvt-unicode/src/rxvtimg.C 2012/06/08 10:12:45 1.60 +++ rxvt-unicode/src/rxvtimg.C 2012/06/08 21:33:32 1.64 @@ -267,11 +267,10 @@ rxvt_img *img = new rxvt_img (s, format, x, y, w, h, repeat); img->alloc (); - Picture src = src_picture (); - XRenderPictureAttributes pa; pa.repeat = RepeatPad; - Picture dst = XRenderCreatePicture (dpy, img->pm, format, CPRepeat, &pa); + Picture src = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); + Picture dst = XRenderCreatePicture (dpy, img->pm, format, 0, 0); Pixmap tmp_pm = XCreatePixmap (dpy, pm, w, h, format->depth); Picture tmp = XRenderCreatePicture (dpy, tmp_pm , format, CPRepeat, &pa); @@ -334,7 +333,7 @@ } void -rxvt_img::brightness (unsigned short r, unsigned short g, unsigned short b, unsigned short a) +rxvt_img::brightness (uint16_t r, uint16_t g, uint16_t b, uint16_t a) { Display *dpy = s->display->dpy; Picture src = create_xrender_mask (dpy, pm, True); @@ -354,10 +353,13 @@ } void -rxvt_img::contrast (unsigned short r, unsigned short g, unsigned short b, unsigned short a) +rxvt_img::contrast (uint16_t r, uint16_t g, uint16_t b, uint16_t a) { if (!(s->display->flags & DISPLAY_HAS_RENDER_MUL)) - return; + { + rxvt_warn ("rxvt_img::contrast operation not supported on this display, RENDER extension too old.\n"); + return; + } Display *dpy = s->display->dpy; Picture src = create_xrender_mask (dpy, pm, True); @@ -410,9 +412,10 @@ Display *dpy = s->display->dpy; - bool alpha = !format->direct.alphaMask - && (x || y) - && repeat == RepeatNone; + // add an alpha channel if... + bool alpha = !format->direct.alphaMask // pixmap has none yet + && (x || y) // we need one because of non-zero offset + && repeat == RepeatNone; // and we have no good pixels to fill with rxvt_img *img = new rxvt_img (s, alpha ? find_alpha_format_for (dpy, format) : format, 0, 0, w, h, repeat); img->alloc ();