From 14892ad2f30be673f35fea399dadc89be863d851 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Sun, 5 Jul 2020 17:33:19 -0700 Subject: get_frame: replace XCreateImage++ w/XGetImage Remove more pointless code --- recordmydesktop/src/rmd_get_frame.c | 39 ++++++++----------------------------- 1 file changed, 8 insertions(+), 31 deletions(-) (limited to 'recordmydesktop/src/rmd_get_frame.c') 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, -- cgit v1.2.3