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.25 by sf-exg, Tue Jun 5 22:00:15 2012 UTC vs.
Revision 1.28 by root, Wed Jun 6 20:22:03 2012 UTC

64 gdk_pixbuf_get_width (pb), 64 gdk_pixbuf_get_width (pb),
65 gdk_pixbuf_get_height (pb) 65 gdk_pixbuf_get_height (pb)
66 ); 66 );
67 67
68 img->render_pixbuf (pb, 0, 0, img->w, img->h, 0, 0); 68 img->render_pixbuf (pb, 0, 0, img->w, img->h, 0, 0);
69
70 g_object_unref (pb);
69 71
70 return img; 72 return img;
71} 73}
72 74
73rxvt_img::~rxvt_img () 75rxvt_img::~rxvt_img ()
423 425
424 return transform (new_width, new_height, matrix, repeat); 426 return transform (new_width, new_height, matrix, repeat);
425} 427}
426 428
427rxvt_img * 429rxvt_img *
428rxvt_img::convert_to (XRenderPictFormat *new_format) 430rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg)
429{ 431{
430 rxvt_img *img = new rxvt_img (s, new_format, w, h); 432 rxvt_img *img = new rxvt_img (s, new_format, w, h);
431 433
432 Display *dpy = s->display->dpy; 434 Display *dpy = s->display->dpy;
433 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); 435 Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0);
434 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;
435 438
439 printf ("fa %x,%x fb %x,%x\n", format->direct.alpha, format->direct.alphaMask, new_format->direct.alpha, new_format->direct.alphaMask);//D
440
441 if (format->direct.alpha && !new_format->direct.alpha)
442 {
443 // does it have to be that complicated
444 rgba c;
445 bg.get (c);
446
447 XRenderColor rc = { c.r, c.g, c.b, 0xffff };
448 XRenderFillRectangle (dpy, PictOpSrc, dst, &rc, 0, 0, w, h);
449
450 op = PictOpOver;
451 }
452
436 XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); 453 XRenderComposite (dpy, op, src, None, dst, 0, 0, 0, 0, 0, 0, w, h);
437 454
438 XRenderFreePicture (dpy, src); 455 XRenderFreePicture (dpy, src);
439 XRenderFreePicture (dpy, dst); 456 XRenderFreePicture (dpy, dst);
440 457
441 return img; 458 return img;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines