diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-06-23 17:11:47 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-07-11 13:36:41 -0700 |
commit | 451548d4c4a1fcab7a95e8678ca63189a0a3cc93 (patch) | |
tree | f67a38cfc5b341ed30ea0212b0c4fd35e5333efc /recordmydesktop | |
parent | 5322492387de537aad9663da403e34546b5571d4 (diff) |
update_image: simplify rmdUpdateImage()
removing some unnecessary nesting
Diffstat (limited to 'recordmydesktop')
-rw-r--r-- | recordmydesktop/src/rmd_update_image.c | 55 |
1 files changed, 26 insertions, 29 deletions
diff --git a/recordmydesktop/src/rmd_update_image.c b/recordmydesktop/src/rmd_update_image.c index 3b5c39f..615bcd3 100644 --- a/recordmydesktop/src/rmd_update_image.c +++ b/recordmydesktop/src/rmd_update_image.c @@ -48,45 +48,42 @@ void rmdUpdateImage( Display * dpy, int shm_opcode, int no_quick_subsample){ - RectArea *temp; unsigned char *dtap=(unsigned char*)datatemp; - temp=*root; + RectArea *temp; - if (temp!=NULL) { - do { - if (noshmem) { - rmdGetZPixmap( dpy, + for (temp = *root; temp; temp = temp->next) { + if (noshmem) { + rmdGetZPixmap( dpy, + specs->root, + datatemp, + temp->rect.x, + temp->rect.y, + temp->rect.width, + temp->rect.height); + } else { + rmdGetZPixmapSHM( dpy, specs->root, + shminfo, + shm_opcode, datatemp, temp->rect.x, temp->rect.y, temp->rect.width, temp->rect.height); - } else { - rmdGetZPixmapSHM( dpy, - specs->root, - shminfo, - shm_opcode, - datatemp,temp->rect.x, - temp->rect.y, - temp->rect.width, - temp->rect.height); - } + } - rmdUpdateYuvBuffer( - yuv, - dtap, - NULL, - temp->rect.x - brwin->rrect.x + enc->x_offset, - temp->rect.y - brwin->rrect.y + enc->y_offset, - temp->rect.width, - temp->rect.height, - no_quick_subsample, - specs->depth - ); - temp=temp->next; - } while (temp!=NULL); + rmdUpdateYuvBuffer( + yuv, + dtap, + NULL, + temp->rect.x - brwin->rrect.x + enc->x_offset, + temp->rect.y - brwin->rrect.y + enc->y_offset, + temp->rect.width, + temp->rect.height, + no_quick_subsample, + specs->depth + ); } } |