ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtimg.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtimg.C (file contents):
Revision 1.11 by root, Mon Jun 4 15:15:49 2012 UTC vs.
Revision 1.12 by root, Mon Jun 4 15:28:49 2012 UTC

217} 217}
218 218
219rxvt_img * 219rxvt_img *
220rxvt_img::transform (int new_width, int new_height, int repeat, double matrix[9]) 220rxvt_img::transform (int new_width, int new_height, int repeat, double matrix[9])
221{ 221{
222 //TODO 222 rxvt_img *img = new rxvt_img (s, format, new_width, new_height);
223
224 Display *dpy = s->display->dpy;
225 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0);
226 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
227
228 XTransform xfrm;
229
230 for (int i = 0; i < 3; ++i)
231 for (int j = 0; j < 3; ++j)
232 xfrm.matrix [i][j] = XDoubleToFixed (matrix [i * 3 + j]);
233
234 XRenderSetPictureTransform (dpy, src, &xfrm);
235 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, new_width, new_height);
236
237 XRenderFreePicture (dpy, src);
238 XRenderFreePicture (dpy, dst);
239
240 return img;
223} 241}
224 242
225rxvt_img * 243rxvt_img *
226rxvt_img::scale (int new_width, int new_height) 244rxvt_img::scale (int new_width, int new_height)
227{ 245{
238rxvt_img::convert_to (XRenderPictFormat *new_format) 256rxvt_img::convert_to (XRenderPictFormat *new_format)
239{ 257{
240 rxvt_img *img = new rxvt_img (s, new_format, w, h); 258 rxvt_img *img = new rxvt_img (s, new_format, w, h);
241 259
242 Display *dpy = s->display->dpy; 260 Display *dpy = s->display->dpy;
243 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); 261 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0);
244 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); 262 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0);
245 263
246 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); 264 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h);
247 265
248 XRenderFreePicture (dpy, src); 266 XRenderFreePicture (dpy, src);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines