diff options
author | runge <runge> | 2007-01-04 01:32:50 +0000 |
---|---|---|
committer | runge <runge> | 2007-01-04 01:32:50 +0000 |
commit | 76a495aff1a1e923363a865bd5b9a0a95332374d (patch) | |
tree | 69b70910dbd5a3b9dab3ef183ac8b91007e070cb /x11vnc/xdamage.c | |
parent | c88d830f5591913f2e5e763814978e2877f367ec (diff) | |
download | libtdevnc-76a495aff1a1e923363a865bd5b9a0a95332374d.tar.gz libtdevnc-76a495aff1a1e923363a865bd5b9a0a95332374d.zip |
x11vnc: more -ncache improvements.
Diffstat (limited to 'x11vnc/xdamage.c')
-rw-r--r-- | x11vnc/xdamage.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/x11vnc/xdamage.c b/x11vnc/xdamage.c index 27e6613..2343a98 100644 --- a/x11vnc/xdamage.c +++ b/x11vnc/xdamage.c @@ -544,6 +544,8 @@ int xdamage_hint_skip(int y) { static sraRegionPtr scanline = NULL; sraRegionPtr reg, tmpl; int ret, i, n, nreg; + static int ncache_no_skip = 0; + static double last_ncache_no_skip = 0.0; if (! xdamage_present || ! use_xdamage) { return 0; /* cannot skip */ @@ -557,9 +559,26 @@ int xdamage_hint_skip(int y) { scanline = sraRgnCreate(); } + nreg = (xdamage_memory * NSCAN) + 1; + + if (ncache > 0) { + if (ncache_no_skip == 0) { + if (dnow() > last_ncache_no_skip + 4.0) { + ncache_no_skip = 1; + last_ncache_no_skip = dnow(); + return 0; + } + } else { + if (++ncache_no_skip >= 2*nreg) { + ncache_no_skip = 0; + } else { + return 0; + } + } + } + tmpl = sraRgnCreateRect(0, y, dpy_x, y+1); - nreg = (xdamage_memory * NSCAN) + 1; ret = 1; for (i=0; i<nreg; i++) { /* go back thru the history starting at most recent */ |