summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/xlib/xm_winsys.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-09-30 11:57:45 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-09-30 11:57:45 +1000
commit8cd046c9b1da31e4ff178816bdfe2ee3451a1553 (patch)
tree6b9de732a9d75c3005a80b078af0c97b9cb6c0ab /src/gallium/winsys/xlib/xm_winsys.c
parent8c14bd6992e338da8e467775b0237c8db7cbe44d (diff)
parent5dc8e67078be8b8c42a809311debd275ac7d64a7 (diff)
Merge remote branch 'origin/gallium-0.2' into gallium-0.2
Diffstat (limited to 'src/gallium/winsys/xlib/xm_winsys.c')
-rw-r--r--src/gallium/winsys/xlib/xm_winsys.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c
index 2acbc94fc8..acb5ad8f71 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;
-
- if (XSHM_ENABLED(xm_buf)) {
+ /* offset in pixels */
+ offset *= TILE_SIZE * TILE_SIZE;
+
+ if (0 && 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 {
+ /* twiddle 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);
}