Commit 8e9f427a authored by dscho's avatar dscho

scheduleCopyRegion no longer sends frameBufferUpdates (no longer clobbers

deferring)
parent 2c4869fc
...@@ -76,21 +76,39 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in ...@@ -76,21 +76,39 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
LOCK(cl->updateMutex); LOCK(cl->updateMutex);
if(cl->useCopyRect) { if(cl->useCopyRect) {
sraRegionPtr modifiedRegionBackup; sraRegionPtr modifiedRegionBackup;
if(!sraRgnEmpty(cl->copyRegion) && (cl->copyDX!=dx || cl->copyDY!=dy)) { if(!sraRgnEmpty(cl->copyRegion)) {
sraRgnOr(cl->copyRegion,cl->modifiedRegion); if(cl->copyDX!=dx || cl->copyDY!=dy) {
/* if a copyRegion was not yet executed, treat it as a
* modifiedRegion. The idea: in this case it could be
* source of the new copyRect or modified anyway. */
sraRgnOr(cl->modifiedRegion,cl->copyRegion);
sraRgnMakeEmpty(cl->copyRegion); sraRgnMakeEmpty(cl->copyRegion);
} else {
/* we have to set the intersection of the source of the copy
* and the old copy to modified. */
modifiedRegionBackup=sraRgnCreateRgn(copyRegion);
sraRgnOffset(modifiedRegionBackup,-dx,-dy);
sraRgnAnd(modifiedRegionBackup,cl->copyRegion);
sraRgnOr(cl->modifiedRegion,modifiedRegionBackup);
sraRgnDestroy(modifiedRegionBackup);
} }
}
sraRgnOr(cl->copyRegion,copyRegion); sraRgnOr(cl->copyRegion,copyRegion);
cl->copyDX = dx; cl->copyDX = dx;
cl->copyDY = dy; cl->copyDY = dy;
/* if there were modified regions, which are now copied: */ /* if there were modified regions, which are now copied,
* mark them as modified, because the source of these can be overlapped
* either by new modified or now copied regions. */
modifiedRegionBackup=sraRgnCreateRgn(cl->modifiedRegion); modifiedRegionBackup=sraRgnCreateRgn(cl->modifiedRegion);
sraRgnOffset(modifiedRegionBackup,dx,dy); sraRgnOffset(modifiedRegionBackup,dx,dy);
sraRgnAnd(modifiedRegionBackup,cl->copyRegion); sraRgnAnd(modifiedRegionBackup,cl->copyRegion);
sraRgnOr(cl->modifiedRegion,modifiedRegionBackup); sraRgnOr(cl->modifiedRegion,modifiedRegionBackup);
sraRgnDestroy(modifiedRegionBackup); sraRgnDestroy(modifiedRegionBackup);
#if 0
//TODO: is this needed? Or does it mess up deferring?
/* while(!sraRgnEmpty(cl->copyRegion)) */ { /* while(!sraRgnEmpty(cl->copyRegion)) */ {
#ifdef HAVE_PTHREADS #ifdef HAVE_PTHREADS
if(!cl->screen->backgroundLoop) if(!cl->screen->backgroundLoop)
...@@ -104,6 +122,7 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in ...@@ -104,6 +122,7 @@ void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen,sraRegionPtr copyRegion,in
continue; continue;
} }
} }
#endif
} else { } else {
sraRgnOr(cl->modifiedRegion,copyRegion); sraRgnOr(cl->modifiedRegion,copyRegion);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment