diff options
author | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2008-09-17 23:09:21 +0000 |
---|---|---|
committer | iovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a> | 2008-09-17 23:09:21 +0000 |
commit | c80162f9433fd0c2c9eafc7ec3a8c8ad6deb4f24 (patch) | |
tree | 543565e2b30b8cef973298ed5d90998ed4cbd9fa /recordmydesktop/src/rmd_get_frame.c | |
parent | e3c7224674c99f7476b93fd1ada7d5c05cad6029 (diff) |
src/rmd_get_frame.c : As Martin has found, we need to mark
both the new and the old area of the cursor, for it to render
correctly. This changeset does that for the full-shots scenario,
(which is always double-buffered) by making dirty the new area
on the back buffer, before the Yuv convertion.
Other changes are that the MARK_BACK_BUFFER macro has been
renamed to MARK_BUFFER_AREA (as that is what it does and there is
nothing intristically tying it to the back buffer) and also
a non-sensical comment was removed (probably a thought I never got
to finish).
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@558 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rmd_get_frame.c')
-rw-r--r-- | recordmydesktop/src/rmd_get_frame.c | 62 |
1 files changed, 44 insertions, 18 deletions
diff --git a/recordmydesktop/src/rmd_get_frame.c b/recordmydesktop/src/rmd_get_frame.c index 12901af..786a078 100644 --- a/recordmydesktop/src/rmd_get_frame.c +++ b/recordmydesktop/src/rmd_get_frame.c @@ -145,7 +145,7 @@ }\ } -#define MARK_BACK_BUFFER_C( data,\ +#define MARK_BUFFER_AREA_C( data,\ x_tm,\ y_tm,\ width_tm,\ @@ -165,7 +165,7 @@ }\ } -#define MARK_BACK_BUFFER( data,\ +#define MARK_BUFFER_AREA( data,\ x_tm,\ y_tm,\ width_tm,\ @@ -173,7 +173,7 @@ buffer_width,\ __bit_depth__){\ if((__bit_depth__==24)||(__bit_depth__==32)){\ - MARK_BACK_BUFFER_C( data,\ + MARK_BUFFER_AREA_C( data,\ x_tm,\ y_tm,\ width_tm,\ @@ -182,7 +182,7 @@ 32)\ }\ else{\ - MARK_BACK_BUFFER_C( data,\ + MARK_BUFFER_AREA_C( data,\ x_tm,\ y_tm,\ width_tm,\ @@ -464,15 +464,6 @@ void *GetFrame(ProgData *pdata){ pdata->args.follow_mouse){ - // ==Old comment== (not sure how to interpret): - //pointer sequence - //update previous_position - //(if full_shots is enabled the new cursor is - //entered on the list for update. - //When taking full shots we keep it for further - //bellow, to mark the area as dirty when dbuffering. - // - // ==New comment== // Pointer sequence: // * Mark previous position as dirty with RectInsert() // * Update to new position @@ -498,13 +489,45 @@ void *GetFrame(ProgData *pdata){ &mouse_pos_abs.x,&mouse_pos_abs.y, &mouse_pos_rel.x,&mouse_pos_rel.y,&msk_ret); } + CLIP_DUMMY_POINTER_AREA(mouse_pos_abs, &temp_brwin, &mouse_pos_temp); - if (!pdata->args.full_shots && - mouse_pos_temp.x >=0 && + if( mouse_pos_temp.x >=0 && mouse_pos_temp.y >=0 && mouse_pos_temp.width > 0 && mouse_pos_temp.height > 0) { - RectInsert(&pdata->rect_root,&mouse_pos_temp); + + //there are 3 capture scenarios: + // * Xdamage + // * full-shots with double buffering + // * full-shots on a single buffer + //The last one cannot be reached through + //this code (see above how the d_buf variable is set), but + //even if it could, it would not be of interest regarding the + //marking of the cursor area. Single buffer means full repaint + //on every frame so there is no need for marking at all. + + if (!pdata->args.full_shots) { + + RectInsert(&pdata->rect_root,&mouse_pos_temp); + + } + else if(d_buff){ + unsigned char *back_buff= + (img_sel)?((unsigned char*)image->data): + ((unsigned char*)image_back->data); + + MARK_BUFFER_AREA( back_buff, + (mouse_pos_temp.x- + temp_brwin.rgeom.x+ + pdata->enc_data->x_offset), + (mouse_pos_temp.y- + temp_brwin.rgeom.y+ + pdata->enc_data->y_offset), + mouse_pos_temp.width, + mouse_pos_temp.height, + (temp_brwin.rgeom.width), + pdata->specs.depth) + } } } if(pdata->args.follow_mouse){ @@ -629,12 +652,15 @@ void *GetFrame(ProgData *pdata){ pdata->npxl); } if(d_buff){ - //make previous cursor position dirty + //make previous cursor position dirty + //on the currently front buffer (which + //will be the back buffer next time it's + //used) unsigned char *front_buff= (!img_sel)?((unsigned char*)image->data): ((unsigned char*)image_back->data); - MARK_BACK_BUFFER( front_buff, + MARK_BUFFER_AREA( front_buff, (mouse_pos_temp.x- temp_brwin.rgeom.x+ pdata->enc_data->x_offset), |