/[cebix]/SheepShaver/src/Unix/video_x.cpp
ViewVC logotype

Diff of /SheepShaver/src/Unix/video_x.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by gbeauche, Sun Oct 26 07:54:02 2003 UTC revision 1.5 by gbeauche, Thu Nov 20 16:24:57 2003 UTC
# Line 197  static bool open_window(int width, int h Line 197  static bool open_window(int width, int h
197                  XFree((char *)hints);                  XFree((char *)hints);
198          }          }
199    
200            // 1-bit mode is big-endian; if the X server is little-endian, we can't
201            // use SHM because that doesn't allow changing the image byte order
202            bool need_msb_image = (depth == 1 && XImageByteOrder(x_display) == LSBFirst);
203    
204          // Try to create and attach SHM image          // Try to create and attach SHM image
205          have_shm = false;          have_shm = false;
206          if (local_X11 && depth != 1 && XShmQueryExtension(x_display)) {          if (local_X11 && !need_msb_image && XShmQueryExtension(x_display)) {
207    
208                  // Create SHM image ("height + 2" for safety)                  // Create SHM image ("height + 2" for safety)
209                  img = XShmCreateImage(x_display, vis, depth, depth == 1 ? XYBitmap : ZPixmap, 0, &shminfo, width, height);                  img = XShmCreateImage(x_display, vis, depth == 1 ? 1 : xdepth, depth == 1 ? XYBitmap : ZPixmap, 0, &shminfo, width, height);
210                  shminfo.shmid = shmget(IPC_PRIVATE, (height + 2) * img->bytes_per_line, IPC_CREAT | 0777);                  shminfo.shmid = shmget(IPC_PRIVATE, (height + 2) * img->bytes_per_line, IPC_CREAT | 0777);
211                  the_buffer_copy = (uint8 *)shmat(shminfo.shmid, 0, 0);                  the_buffer_copy = (uint8 *)shmat(shminfo.shmid, 0, 0);
212                  shminfo.shmaddr = img->data = (char *)the_buffer_copy;                  shminfo.shmaddr = img->data = (char *)the_buffer_copy;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Christian Bauer">Christian Bauer
ViewVC Help
Powered by ViewVC 1.1.15