drisw/winsys: loop over all the boxes in display()
Acked-by: Daniel Stone <daniels@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27703>
This commit is contained in:

committed by
Marge Bot

parent
389e83c4fe
commit
cda627eb48
@@ -250,41 +250,39 @@ dri_sw_displaytarget_display(struct sw_winsys *ws,
|
|||||||
struct dri_drawable *dri_drawable = (struct dri_drawable *)context_private;
|
struct dri_drawable *dri_drawable = (struct dri_drawable *)context_private;
|
||||||
unsigned width, height, x = 0, y = 0;
|
unsigned width, height, x = 0, y = 0;
|
||||||
unsigned blsize = util_format_get_blocksize(dri_sw_dt->format);
|
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;
|
bool is_shm = dri_sw_dt->shmid != -1;
|
||||||
/* Set the width to 'stride / cpp'.
|
/* Set the width to 'stride / cpp'.
|
||||||
*
|
*
|
||||||
* PutImage correctly clips to the width of the dst drawable.
|
* PutImage correctly clips to the width of the dst drawable.
|
||||||
*/
|
*/
|
||||||
if (nboxes == 1) {
|
if (!nboxes) {
|
||||||
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;
|
|
||||||
height = box->height;
|
|
||||||
} else {
|
|
||||||
width = dri_sw_dt->stride / blsize;
|
width = dri_sw_dt->stride / blsize;
|
||||||
height = dri_sw_dt->height;
|
height = dri_sw_dt->height;
|
||||||
}
|
if (is_shm)
|
||||||
|
dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, 0, 0,
|
||||||
if (is_shm) {
|
0, 0, width, height, dri_sw_dt->stride);
|
||||||
dri_sw_ws->lf->put_image_shm(dri_drawable, dri_sw_dt->shmid, dri_sw_dt->data, offset, offset_x,
|
else
|
||||||
x, y, width, height, dri_sw_dt->stride);
|
dri_sw_ws->lf->put_image(dri_drawable, dri_sw_dt->data, width, height);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
for (unsigned i = 0; i < nboxes; i++) {
|
||||||
if (nboxes == 1)
|
unsigned offset = dri_sw_dt->stride * box[i].y;
|
||||||
dri_sw_ws->lf->put_image2(dri_drawable, data,
|
unsigned offset_x = box[i].x * blsize;
|
||||||
x, y, width, height, dri_sw_dt->stride);
|
char *data = dri_sw_dt->data + offset;
|
||||||
else
|
x = box[i].x;
|
||||||
dri_sw_ws->lf->put_image(dri_drawable, data, width, height);
|
y = box[i].y;
|
||||||
|
width = box[i].width;
|
||||||
|
height = box[i].height;
|
||||||
|
if (is_shm) {
|
||||||
|
/* don't add x offset for shm, the put_image_shm will deal with it */
|
||||||
|
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);
|
||||||
|
} else {
|
||||||
|
data += offset_x;
|
||||||
|
dri_sw_ws->lf->put_image2(dri_drawable, data,
|
||||||
|
x, y, width, height, dri_sw_dt->stride);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Reference in New Issue
Block a user