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.71 by sf-exg, Sat Jun 9 14:18:53 2012 UTC vs.
Revision 1.73 by sf-exg, Sat Jun 9 17:28:03 2012 UTC

49 img->ref->ours = false; 49 img->ref->ours = false;
50 50
51 return img; 51 return img;
52} 52}
53 53
54# if HAVE_PIXBUF
54rxvt_img * 55rxvt_img *
55rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb) 56rxvt_img::new_from_pixbuf (rxvt_screen *s, GdkPixbuf *pb)
56{ 57{
57 Display *dpy = s->display->dpy; 58 Display *dpy = s->display->dpy;
58 59
166 167
167 g_object_unref (pb); 168 g_object_unref (pb);
168 169
169 return img; 170 return img;
170} 171}
172# endif
171 173
172void 174void
173rxvt_img::destroy () 175rxvt_img::destroy ()
174{ 176{
175 if (--ref->cnt) 177 if (--ref->cnt)
312 XRenderFreePicture (dpy, src); 314 XRenderFreePicture (dpy, src);
313 XRenderFreePicture (dpy, dst); 315 XRenderFreePicture (dpy, dst);
314 XRenderFreePicture (dpy, tmp); 316 XRenderFreePicture (dpy, tmp);
315 317
316 return img; 318 return img;
317}
318
319static Picture
320create_xrender_mask (Display *dpy, Drawable drawable, Bool argb)
321{
322 Pixmap pixmap = XCreatePixmap (dpy, drawable, 1, 1, argb ? 32 : 8);
323
324 XRenderPictFormat *format = XRenderFindStandardFormat (dpy, argb ? PictStandardARGB32 : PictStandardA8);
325 XRenderPictureAttributes pa;
326 pa.repeat = True;
327 Picture mask = XRenderCreatePicture (dpy, pixmap, format, CPRepeat, &pa);
328
329 XFreePixmap (dpy, pixmap);
330
331 return mask;
332} 319}
333 320
334static void 321static void
335extract (int32_t cl0, int32_t cl1, int32_t &c, unsigned short &xc) 322extract (int32_t cl0, int32_t cl1, int32_t &c, unsigned short &xc)
336{ 323{
595{ 582{
596 rxvt_img *img2 = clone (); 583 rxvt_img *img2 = clone ();
597 Display *dpy = s->display->dpy; 584 Display *dpy = s->display->dpy;
598 Picture src = img->src_picture (); 585 Picture src = img->src_picture ();
599 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); 586 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0);
600 Picture mask = create_xrender_mask (dpy, img->pm, False); 587
588 Pixmap pixmap = XCreatePixmap (dpy, img->pm, 1, 1, 8);
589 XRenderPictFormat *format = XRenderFindStandardFormat (dpy, PictStandardA8);
590 XRenderPictureAttributes pa;
591 pa.repeat = True;
592 Picture mask = XRenderCreatePicture (dpy, pixmap, format, CPRepeat, &pa);
593 XFreePixmap (dpy, pixmap);
601 594
602 XRenderColor mask_c; 595 XRenderColor mask_c;
603 596
604 mask_c.alpha = float_to_component (factor); 597 mask_c.alpha = float_to_component (factor);
605 mask_c.red = 598 mask_c.red =

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines