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.26 by sf-exg, Wed Jun 6 18:13:03 2012 UTC vs.
Revision 1.29 by root, Wed Jun 6 20:55:36 2012 UTC

425 425
426 return transform (new_width, new_height, matrix, repeat); 426 return transform (new_width, new_height, matrix, repeat);
427} 427}
428 428
429rxvt_img * 429rxvt_img *
430rxvt_img::convert_to (XRenderPictFormat *new_format) 430rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg)
431{ 431{
432 rxvt_img *img = new rxvt_img (s, new_format, w, h); 432 rxvt_img *img = new rxvt_img (s, new_format, w, h);
433 433
434 Display *dpy = s->display->dpy; 434 Display *dpy = s->display->dpy;
435 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); 435 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0);
436 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); 436 Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0);
437 int op = PictOpSrc;
437 438
439 if (format->direct.alphaMask && !new_format->direct.alphaMask)
440 {
441 // does it have to be that complicated
442 rgba c;
443 bg.get (c);
444
445 XRenderColor rc = { c.r, c.g, c.b, 0xffff };
446 XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);
447
448 op = PictOpOver;
449 }
450
438 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); 451 XRenderComposite (dpy, op, src, None, dst, 0, 0, 0, 0, 0, 0, w, h);
439 452
440 XRenderFreePicture (dpy, src); 453 XRenderFreePicture (dpy, src);
441 XRenderFreePicture (dpy, dst); 454 XRenderFreePicture (dpy, dst);
442 455
443 return img; 456 return img;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines