--- rxvt-unicode/src/rxvtimg.C 2012/06/04 16:12:55 1.16 +++ rxvt-unicode/src/rxvtimg.C 2012/06/04 18:17:25 1.17 @@ -103,7 +103,7 @@ XRenderPictureAttributes pa; pa.repeat = RepeatPad; - Picture src = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); + Picture src = XRenderCreatePicture (dpy, pm , format, CPRepeat, &pa); Pixmap tmp = XCreatePixmap (dpy, pm, w, h, format->depth); Picture dst = XRenderCreatePicture (dpy, tmp, format, CPRepeat, &pa); XFreePixmap (dpy, tmp); @@ -348,6 +348,7 @@ for (int j = 0; j < 3; ++j) xfrm.matrix [i][j] = XDoubleToFixed (matrix [i * 3 + j]); + XRenderSetPictureFilter (dpy, src, "good", 0, 0); XRenderSetPictureTransform (dpy, src, &xfrm); XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, new_width, new_height); @@ -370,6 +371,21 @@ } rxvt_img * +rxvt_img::rotate (int new_width, int new_height, int repeat, int x, int y, double phi) +{ + double s = sin (phi); + double c = cos (phi); + + double matrix[9] = { + c, -s, -c * x + s * y + x, + s, c, -s * x - c * y + y, + 0, 0, 1 + }; + + return transform (new_width, new_height, repeat, matrix); +} + +rxvt_img * rxvt_img::convert_to (XRenderPictFormat *new_format) { rxvt_img *img = new rxvt_img (s, new_format, w, h);