ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/px/x11raster.c
(Generate patch)

Comparing ray/src/px/x11raster.c (file contents):
Revision 1.1 by greg, Thu Mar 1 13:18:23 1990 UTC vs.
Revision 1.2 by greg, Thu Mar 1 18:13:34 1990 UTC

# Line 48 | Line 48 | int    bm_pad;
48                          ZPixmap,0,data,width,height,bm_pad,0);
49          xr->gc = XCreateGC(disp, RootWindow(disp,scrn), 0, 0);
50          XSetState(disp, xr->gc, BlackPixel(disp,scrn), WhitePixel(disp,scrn),
51 <                        GXcopy, ~0L);
51 >                        GXcopy, AllPlanes);
52          return(xr);
53   }
54  
# Line 157 | Line 157 | register XRASTER       *xr;
157                  return(0);
158          put_raster(pm, 0, 0, xr);
159          return(xr->pm = pm);
160 + }
161 +
162 +
163 + patch_raster(d, xsrc, ysrc, xdst, ydst, width, height, xr)      /* redraw */
164 + Drawable        d;
165 + int     xsrc, ysrc, xdst, ydst;
166 + int     width, height;
167 + register XRASTER        *xr;
168 + {
169 +        if (xsrc >= xr->image->width || ysrc >= xr->image->height)
170 +                return;
171 +        if (xsrc < 0) {
172 +                xdst -= xsrc; width += xsrc;
173 +                xsrc = 0;
174 +        }
175 +        if (ysrc < 0) {
176 +                ydst -= ysrc; height += ysrc;
177 +                ysrc = 0;
178 +        }
179 +        if (width <= 0 || height <= 0)
180 +                return;
181 +        if (xsrc + width > xr->image->width)
182 +                width = xr->image->width - xsrc;
183 +        if (ysrc + height > xr->image->height)
184 +                height = xr->image->height - ysrc;
185 +
186 +        if (xr->pm == 0)
187 +                XPutImage(xr->disp, d, xr->gc, xr->image, xsrc, ysrc,
188 +                                xdst, ydst, width, height);
189 +        else
190 +                XCopyArea(xr->disp, xr->pm, d, xr->gc, xsrc, ysrc,
191 +                                width, height, xdst, ydst);
192   }
193  
194  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines