summaryrefslogtreecommitdiffstats
path: root/rfbserver.c
diff options
context:
space:
mode:
authordscho <dscho>2004-01-21 15:25:41 +0000
committerdscho <dscho>2004-01-21 15:25:41 +0000
commit34fc97a52add15a0b3060fac23bad6bc5324403a (patch)
tree5fd054e0800f6b046e40f9664994cd1eb0bc29f3 /rfbserver.c
parent3a472f8805ad45f43101900126b86c11a5cf01c5 (diff)
downloadlibtdevnc-34fc97a52add15a0b3060fac23bad6bc5324403a.tar.gz
libtdevnc-34fc97a52add15a0b3060fac23bad6bc5324403a.zip
add "-progressive height" option to make SendFramebufferUpdate "preemptive"
Diffstat (limited to 'rfbserver.c')
-rw-r--r--rfbserver.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/rfbserver.c b/rfbserver.c
index 914aa0b..1b11e6b 100644
--- a/rfbserver.c
+++ b/rfbserver.c
@@ -340,6 +340,8 @@ rfbNewTCPOrUDPClient(rfbScreen,sock,isUDP)
cl->zlibCompressLevel = 5;
#endif
+ cl->progressiveSliceY = 0;
+
sprintf(pv,rfbProtocolVersionFormat,rfbProtocolMajorVersion,
rfbProtocolMinorVersion);
@@ -1109,6 +1111,26 @@ rfbSendFramebufferUpdate(cl, givenUpdateRegion)
*/
updateRegion = sraRgnCreateRgn(givenUpdateRegion);
+ if(cl->screen->progressiveSliceHeight>0) {
+ int height=cl->screen->progressiveSliceHeight,
+ y=cl->progressiveSliceY;
+ sraRegionPtr bbox=sraRgnBBox(updateRegion);
+ sraRect rect;
+ if(sraRgnPopRect(bbox,&rect,0)) {
+ sraRegionPtr slice;
+ if(y<rect.y1 || y>=rect.y2)
+ y=rect.y1;
+ slice=sraRgnCreateRect(0,y,cl->screen->width,y+height);
+ sraRgnAnd(updateRegion,slice);
+ sraRgnDestroy(slice);
+ }
+ sraRgnDestroy(bbox);
+ y+=height;
+ if(y>=cl->screen->height)
+ y=0;
+ cl->progressiveSliceY=y;
+ }
+
sraRgnOr(updateRegion,cl->copyRegion);
if(!sraRgnAnd(updateRegion,cl->requestedRegion) &&
!sendCursorShape && !sendCursorPos) {