summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys/sw/xlib/xlib_sw_winsys.c')
-rw-r--r--src/gallium/winsys/sw/xlib/xlib_sw_winsys.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
index 0eea71b7523..57e13084037 100644
--- a/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
+++ b/src/gallium/winsys/sw/xlib/xlib_sw_winsys.c
@@ -295,13 +295,15 @@ xlib_displaytarget_destroy(struct sw_winsys *ws,
*/
static void
xlib_sw_display(struct xlib_drawable *xlib_drawable,
- struct sw_displaytarget *dt)
+ struct sw_displaytarget *dt,
+ struct pipe_box *box)
{
static bool no_swap = false;
static bool firsttime = true;
struct xlib_displaytarget *xlib_dt = xlib_displaytarget(dt);
Display *display = xlib_dt->display;
XImage *ximage;
+ struct pipe_box _box = {};
if (firsttime) {
no_swap = getenv("SP_NO_RAST") != NULL;
@@ -311,6 +313,12 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable,
if (no_swap)
return;
+ if (!box) {
+ _box.width = xlib_dt->width;
+ _box.height = xlib_dt->height;
+ box = &_box;
+ }
+
if (xlib_dt->drawable != xlib_drawable->drawable) {
if (xlib_dt->gc) {
XFreeGC(display, xlib_dt->gc);
@@ -346,7 +354,8 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable,
/* _debug_printf("XSHM\n"); */
XShmPutImage(xlib_dt->display, xlib_drawable->drawable, xlib_dt->gc,
- ximage, 0, 0, 0, 0, xlib_dt->width, xlib_dt->height, False);
+ ximage, box->x, box->y, box->x, box->y,
+ box->width, box->height, False);
}
else {
/* display image in Window */
@@ -364,7 +373,8 @@ xlib_sw_display(struct xlib_drawable *xlib_drawable,
/* _debug_printf("XPUT\n"); */
XPutImage(xlib_dt->display, xlib_drawable->drawable, xlib_dt->gc,
- ximage, 0, 0, 0, 0, xlib_dt->width, xlib_dt->height);
+ ximage, box->x, box->y, box->x, box->y,
+ box->width, box->height);
}
XFlush(xlib_dt->display);
@@ -382,7 +392,7 @@ xlib_displaytarget_display(struct sw_winsys *ws,
struct pipe_box *box)
{
struct xlib_drawable *xlib_drawable = (struct xlib_drawable *)context_private;
- xlib_sw_display(xlib_drawable, dt);
+ xlib_sw_display(xlib_drawable, dt, box);
}