ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/video_x.cpp
(Generate patch)

Comparing SheepShaver/src/Unix/video_x.cpp (file contents):
Revision 1.4 by gbeauche, 2003-10-26T07:54:02Z vs.
Revision 1.5 by gbeauche, 2003-11-20T16:24:57Z

# Line 197 | Line 197 | static bool open_window(int width, int h
197                  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
205          have_shm = false;
206 <        if (local_X11 && depth != 1 && XShmQueryExtension(x_display)) {
206 >        if (local_X11 && !need_msb_image && XShmQueryExtension(x_display)) {
207  
208                  // Create SHM image ("height + 2" for safety)
209 <                img = XShmCreateImage(x_display, vis, depth, depth == 1 ? XYBitmap : ZPixmap, 0, &shminfo, width, height);
209 >                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);
211                  the_buffer_copy = (uint8 *)shmat(shminfo.shmid, 0, 0);
212                  shminfo.shmaddr = img->data = (char *)the_buffer_copy;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines