diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-02-19 04:24:02 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-02-19 04:24:02 +0000 |
commit | cbd6affc1bcf169c184a3241747a6691c9a58bf7 (patch) | |
tree | 2bfc8a9bc5322b924e8558d39140656e1a2a1c05 /lib/mesa/src/gallium/winsys/sw | |
parent | df3e736303c669580785ffc3f94a16997685c8df (diff) |
Merge Mesa 18.3.4
Diffstat (limited to 'lib/mesa/src/gallium/winsys/sw')
-rw-r--r-- | lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.c b/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.c index cd44b036c..c0200f939 100644 --- a/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.c +++ b/lib/mesa/src/gallium/winsys/sw/dri/dri_sw_winsys.c @@ -244,15 +244,20 @@ dri_sw_displaytarget_display(struct sw_winsys *ws, unsigned width, height, x = 0, y = 0; unsigned blsize = util_format_get_blocksize(dri_sw_dt->format); unsigned offset = 0; + unsigned offset_x = 0; char *data = dri_sw_dt->data; - + bool is_shm = dri_sw_dt->shmid != -1; /* Set the width to 'stride / cpp'. * * PutImage correctly clips to the width of the dst drawable. */ if (box) { - offset = (dri_sw_dt->stride * box->y) + box->x * blsize; + offset = dri_sw_dt->stride * box->y; + offset_x = box->x * blsize; data += offset; + /* don't add x offset for shm, the put_image_shm will deal with it */ + if (!is_shm) + data += offset_x; x = box->x; y = box->y; width = box->width; @@ -262,8 +267,8 @@ dri_sw_displaytarget_display(struct sw_winsys *ws, height = dri_sw_dt->height; } - if (dri_sw_dt->shmid != -1) { - dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset, + if (is_shm) { + dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset, offset_x, x, y, width, height, dri_sw_dt->stride); return; } |