summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/xlib
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-09-12 11:35:22 -0600
committerBrian Paul <[email protected]>2008-09-12 11:37:08 -0600
commit44e53b37a02933f238b438e5dc3a2891da5eb51a (patch)
tree3c9e9f6ecdbf51e7880fb5fc72ea6ce17ba35c79 /src/gallium/winsys/xlib
parent33aa5b69642405fbc300430bed1f2ccf521f3086 (diff)
cell: fix twiddled tile display for XSHM. Fixed blank window problem.
Diffstat (limited to 'src/gallium/winsys/xlib')
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 2acbc94fc8d..3334af175bc 100644
--- a/src/gallium/winsys/xlib/xm_winsys.c
+++ b/src/gallium/winsys/xlib/xm_winsys.c
@@ -349,19 +349,26 @@ xmesa_display_surface_tiled(XMesaBuffer b, const struct pipe_surface *surf)
if (x + w > surf->width)
w = surf->width - x;
- offset *= 4 * TILE_SIZE * TILE_SIZE;
-
- twiddle_tile((uint *) ((char *) xm_buf->data + offset),
- tmpTile);
- ximage->data = (char*) tmpTile;
+ /* offset in pixels */
+ offset *= TILE_SIZE * TILE_SIZE;
if (XSHM_ENABLED(xm_buf)) {
+ ximage->data = (char *) xm_buf->data + 4 * offset;
+ /* make copy of tile data */
+ memcpy(tmpTile, (uint *) ximage->data, sizeof(tmpTile));
+ /* twiddle from temp to ximage in shared memory */
+ twiddle_tile(tmpTile, (uint *) ximage->data);
+ /* display image in shared memory */
#if defined(USE_XSHM) && !defined(XFree86Server)
XShmPutImage(b->xm_visual->display, b->drawable, b->gc,
ximage, 0, 0, x, y, w, h, False);
#endif
}
else {
+ /* twiddel from ximage buffer to temp tile */
+ twiddle_tile((uint *) xm_buf->data + offset, tmpTile);
+ /* display temp tile data */
+ ximage->data = (char *) tmpTile;
XPutImage(b->xm_visual->display, b->drawable, b->gc,
ximage, 0, 0, x, y, w, h);
}