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 2.5 by greg, Wed May 27 14:28:54 1992 UTC vs.
Revision 2.6 by greg, Thu May 28 09:39:22 1992 UTC

# Line 41 | Line 41 | int    bm_pad;
41                  xr->image = XCreateImage(disp,vis->visual,vis->depth,
42                                  ZPixmap,0,data,width,height,bm_pad,0);
43          xr->image->bitmap_bit_order = MSBFirst;
44 +        xr->image->bitmap_unit = bm_pad;
45          xr->image->byte_order = *(char *)&swaptest ? LSBFirst : MSBFirst;
46          if (vis->depth >= 24 && (xr->image->red_mask != 0xff ||
47                          xr->image->green_mask != 0xff00 ||
# Line 65 | Line 66 | int    rmap[256], gmap[256], bmap[256];
66          register unsigned char  *p;
67          register int    i;
68  
69 <        if (xr->image->depth != 8 || xr->ncolors != 0)
69 >        if (xr->image->depth > 8 || xr->ncolors != 0)
70                  return(xr->ncolors);
71          xr->pmap = (short *)malloc(256*sizeof(short));
72          if (xr->pmap == NULL)
# Line 146 | Line 147 | Window w;
147          register int    i;
148          register unsigned char  *p;
149  
150 <        if (xr->ncolors == 0 || xr->image->depth != 8)
150 >        if (xr->ncolors == 0 || xr->image->depth > 8)
151                  return(NULL);
152          if (xr->pixels != NULL)
153                  return(xr->pixels);
# Line 189 | Line 190 | Window w;
190  
191  
192   Pixmap
193 < make_rpixmap(xr, d)                     /* make pixmap for raster */
193 > make_rpixmap(xr, w)                     /* make pixmap for raster */
194   register XRASTER        *xr;
195 < Drawable        d;
195 > Window  w;
196   {
197 +        XWindowAttributes       xwattr;
198          Pixmap  pm;
199  
200          if (xr->pm != 0)
201                  return(xr->pm);
202 <        pm = XCreatePixmap(xr->disp, d,
202 >        XGetWindowAttributes(xr->disp, w, &xwattr);
203 >        pm = XCreatePixmap(xr->disp, w,
204                          xr->image->width, xr->image->height,
205 <                        xr->image->depth);
205 >                        xwattr.depth);
206          if (pm == 0)
207                  return(0);
208          put_raster(pm, 0, 0, xr);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines