diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-07-05 17:33:19 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-07-11 13:36:41 -0700 |
commit | 14892ad2f30be673f35fea399dadc89be863d851 (patch) | |
tree | 71b124db85bf44bb6c4b319a21e061a0cd33ce33 /recordmydesktop/src | |
parent | 690bc1878842e834048010f10e3903ee95bec729 (diff) |
get_frame: replace XCreateImage++ w/XGetImage
Remove more pointless code
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r-- | recordmydesktop/src/rmd_get_frame.c | 39 |
1 files changed, 8 insertions, 31 deletions
diff --git a/recordmydesktop/src/rmd_get_frame.c b/recordmydesktop/src/rmd_get_frame.c index 780fe70..95f3886 100644 --- a/recordmydesktop/src/rmd_get_frame.c +++ b/recordmydesktop/src/rmd_get_frame.c @@ -124,37 +124,14 @@ static int rmdFirstFrame(ProgData *pdata, XImage **image, XShmSegmentInfo *shmin const XRectangle *rrect = &pdata->brwin.rrect; if ((pdata->args.noshared)) { - char *pxl_data; - size_t nbytes; - - /* XXX: this was blindly relocated from rmdSetBRWindow(), - * I'm unclear on why there's this alignment crap happening, - * but just wanted to to move nbytes out to the one place it's - * used. - */ - nbytes = (((rrect->width + 15) >> 4) << 4) * - (((rrect->height + 15) >> 4) << 4) * - ((pdata->specs.depth == 16) ? 2 : 4); - - pxl_data = (char *)malloc(nbytes); - - (*image) = XCreateImage( pdata->dpy, - pdata->specs.visual, - pdata->specs.depth, - ZPixmap, - 0, - pxl_data, - rrect->width, - rrect->height, - 8, - 0); - - rmdGetZPixmap( pdata->dpy,pdata->specs.root, - (*image)->data, - rrect->x, - rrect->y, - rrect->width, - rrect->height); + (*image) = XGetImage( pdata->dpy, + pdata->specs.root, + rrect->x, + rrect->y, + rrect->width, + rrect->height, + AllPlanes, + ZPixmap); } else { (*image) = XShmCreateImage( pdata->dpy, pdata->specs.visual, |