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.34 by root, Thu Jun 7 08:36:09 2012 UTC vs.
Revision 1.39 by root, Thu Jun 7 10:19:23 2012 UTC

113 Display *dpy = s->display->dpy; 113 Display *dpy = s->display->dpy;
114 114
115 XRenderPictureAttributes pa; 115 XRenderPictureAttributes pa;
116 pa.repeat = repeat; 116 pa.repeat = repeat;
117 Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); 117 Picture pic = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa);
118
119 XRectangle clip = { -x, -y, min (w, ref->w), min (h, ref->h) };
120 XRenderSetPictureClipRectangles (dpy, pic, 0, 0, &clip, 1);
121 118
122 return pic; 119 return pic;
123} 120}
124 121
125void 122void
397} 394}
398 395
399rxvt_img * 396rxvt_img *
400rxvt_img::reify () 397rxvt_img::reify ()
401{ 398{
399 if (x == 0 && y == 0 && w == ref->w && h == ref->h)
400 return clone ();
401
402 rxvt_img *img = new rxvt_img (s, format, 0, 0, w, h); 402 rxvt_img *img = new rxvt_img (s, format, 0, 0, w, h);
403 img->alloc (); 403 img->alloc ();
404
405 // todo, if x==0 and y==0 and w==real width we could clone
406 // but that involves an rtt to find pixmap width.
407 404
408 Display *dpy = s->display->dpy; 405 Display *dpy = s->display->dpy;
409 406
410 Picture src = src_picture (); 407 Picture src = src_picture ();
411 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); 408 Picture dst = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0);
421rxvt_img * 418rxvt_img *
422rxvt_img::sub_rect (int x, int y, int width, int height) 419rxvt_img::sub_rect (int x, int y, int width, int height)
423{ 420{
424 rxvt_img *img = clone (); 421 rxvt_img *img = clone ();
425 422
426 //TODO: width > w, must reify
427
428 img->x += x; 423 img->x += x;
429 img->y += y; 424 img->y += y;
425
426 if (w != width || h != height)
427 {
430 img->w = width; 428 img->w = width;
431 img->h = height; 429 img->h = height;
430
431 rxvt_img *img2 = img->reify ();
432 delete img;
433 img = img2;
434 }
432 435
433 return img; 436 return img;
434} 437}
435 438
436rxvt_img * 439rxvt_img *
526rxvt_img * 529rxvt_img *
527rxvt_img::blend (rxvt_img *img, double factor) 530rxvt_img::blend (rxvt_img *img, double factor)
528{ 531{
529 rxvt_img *img2 = clone (); 532 rxvt_img *img2 = clone ();
530 Display *dpy = s->display->dpy; 533 Display *dpy = s->display->dpy;
531 Picture src = src_picture (); 534 Picture src = img->src_picture ();
532 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); 535 Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0);
533 Picture mask = create_xrender_mask (dpy, img->pm, False); 536 Picture mask = create_xrender_mask (dpy, img->pm, False);
534 537
535 XRenderColor mask_c; 538 XRenderColor mask_c;
536 539

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines