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.13 by root, Mon Jun 4 15:30:41 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 XRenderPictureAttributes pa;
226 pa.repeat = repeat;
227 Picture src = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa);
228 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
229
230 XTransform xfrm;
231
232 for (int i = 0; i < 3; ++i)
233 for (int j = 0; j < 3; ++j)
234 xfrm.matrix [i][j] = XDoubleToFixed (matrix [i * 3 + j]);
235
236 XRenderSetPictureTransform (dpy, src, &xfrm);
237 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, new_width, new_height);
238
239 XRenderFreePicture (dpy, src);
240 XRenderFreePicture (dpy, dst);
241
242 return img;
223} 243}
224 244
225rxvt_img * 245rxvt_img *
226rxvt_img::scale (int new_width, int new_height) 246rxvt_img::scale (int new_width, int new_height)
227{ 247{
238rxvt_img::convert_to (XRenderPictFormat *new_format) 258rxvt_img::convert_to (XRenderPictFormat *new_format)
239{ 259{
240 rxvt_img *img = new rxvt_img (s, new_format, w, h); 260 rxvt_img *img = new rxvt_img (s, new_format, w, h);
241 261
242 Display *dpy = s->display->dpy; 262 Display *dpy = s->display->dpy;
243 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); 263 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0);
244 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); 264 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0);
245 265
246 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); 266 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h);
247 267
248 XRenderFreePicture (dpy, src); 268 XRenderFreePicture (dpy, src);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines