XGetSubImage(dpy, window, 0, y, scanline->width,
XGetSubImage_wr(dpy, window, 0, y, scanline->width,
static int scan_display(int ystart, int rescan) {	char *src, *dst;	int pixelsize = bpp >> 3;	int x, y, w, n;	int tile_count = 0;	int whole_line = 1, nodiffs = 0;	y = ystart;	while (y < dpy_y) {		/* grab the horizontal scanline from the display: */		X_LOCK;		if (using_shm) {			XShmGetImage(dpy, window, scanline, 0, y, AllPlanes);		} else {			XGetSubImage(dpy, window, 0, y, scanline->width,			    scanline->height, AllPlanes, ZPixmap, scanline,			    0, 0);		}		X_UNLOCK;		/* for better memory i/o try the whole line at once */		src = scanline->data;		dst = main_fb + y * main_bytes_per_line;		if (whole_line && ! memcmp(dst, src, main_bytes_per_line)) {			/* no changes anywhere in scan line */			nodiffs = 1;			if (! rescan) {				y += NSCAN;				continue;			}		}		x = 0;		while (x < dpy_x) {			n = (x/tile_x) + (y/tile_y) * ntiles_x;			if (blackouts) {				if (blackout_line_skip(n, x, y, rescan,				    &tile_count)) {					x += NSCAN;					continue;				}			}			if (rescan) {				if (nodiffs || tile_has_diff[n]) {					tile_count += tile_has_diff[n];					x += NSCAN;					continue;				}			}			/* set ptrs to correspond to the x offset: */			src = scanline->data + x * pixelsize;			dst = main_fb + y * main_bytes_per_line + x * pixelsize;			/* compute the width of data to be compared: */			if (x + NSCAN > dpy_x) {				w = dpy_x - x;			} else {				w = NSCAN;			}			if (memcmp(dst, src, w * pixelsize)) {				/* found a difference, record it: */				if (! blackouts) {					tile_has_diff[n] = 1;					tile_count++;						} else {					if (blackout_line_cmpskip(n, x, y,					    dst, src, w, pixelsize)) {						tile_has_diff[n] = 0;					} else {						tile_has_diff[n] = 1;						tile_count++;							}				}			}			x += NSCAN;		}		y += NSCAN;	}	return tile_count;}